[理工] 用binary semaphore實作counting semapho

看板Grad-ProbAsk作者 (殘月之肅)時間4年前 (2021/01/28 22:59), 編輯推噓0(003)
留言3則, 2人參與, 4年前最新討論串1/1
https://i.imgur.com/tnhTwu9.jpg
想問為什麼signal(S)的部分,為什麼不是if(c >= 0)而是(c <= 0)? ----- Sent from JPTT on my iPad -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 119.14.8.83 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1611845989.A.E38.html

01/29 00:43, 4年前 , 1F
左邊卡在wait(s2)且c往負數,右邊則往正的加到0之前都
01/29 00:43, 1F

01/29 00:43, 4年前 , 2F
代表還有人被卡在wait(s2)
01/29 00:43, 2F

01/29 17:53, 4年前 , 3F
了解,感謝樓上
01/29 17:53, 3F
文章代碼(AID): #1W4j5buu (Grad-ProbAsk)