看板 [ Python ]
討論串[問題] blocking queue 實作
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者sean72時間7年前 (2018/07/22 03:46), 7年前編輯資訊
0
0
5
內容預覽:
Q1. https://docs.python.org/3/library/threading.html#threading.Condition.wait. This method releases the underlying lock, and then blocks until it is.
(還有819個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 7年前最新作者sean72 (.)時間7年前 (2018/07/21 18:21), 編輯資訊
0
0
3
內容預覽:
C1 先取得lock. C1 wait and release lock. C2 取得lock. C2 wait and release lock. P1 此時P1 notify ,這個notify會按照wait的順序,先給C1 ? 還是C1 C2任選?. --. 發信站: 批踢踢實業坊(ptt

推噓5(5推 0噓 2→)留言7則,0人參與, 7年前最新作者sean72 (.)時間7年前 (2018/07/21 17:25), 7年前編輯資訊
0
0
2
內容預覽:
謝謝幫忙review. https://paste.ubuntu.com/p/Zjh3y6ychm/. 抄了source code,改成這樣. Consumer1先跑,取得了self.not_empty,並且因為que == 0. 所以等在while loop裡 (wait()). Consumer
(還有252個字)

推噓2(2推 0噓 2→)留言4則,0人參與, 7年前最新作者sean72 (.)時間7年前 (2018/07/18 15:13), 6年前編輯資訊
0
0
1
內容預覽:
實現一個 thread safe, blocking bounded Queue. my implementation. https://paste.ubuntu.com/p/697Qv8dRtR/. follow up. 必須支援multi put. 我這樣的做法有滿足要求嗎?. 我不是很了解mu
(還有197個字)
首頁
上一頁
1
下一頁
尾頁