看板 Grad-ProbAsk 關於我們 聯絡資訊
http://i.imgur.com/NjKvHD8.jpg pthread_join(t1,NULL)這個指令 是不是會讓t1暫停,等到其他行程執行完再執行 如果是的話下面是我畫的圖 想問看看哪裡有錯呢? 跟解答對不太上QQ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.115.50.59 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1486304416.A.7D2.html
yupog2003: 應該不是讓t1暫停,而是讓call pthread_join的thread 02/05 22:28
yupog2003: 暫停,等t1執行完了再繼續 02/05 22:29
EasonGod: http://i.imgur.com/VbUwAMl.jpg 02/05 22:34
EasonGod: 這個是我查到的,他這樣說不是讓tid1先暫停嗎? 02/05 22:34
EasonGod: http://i.imgur.com/lspMDCH.jpg 02/05 22:39
EasonGod: 剛剛又看到這個,他說會等target thread執行完,所以括 02/05 22:39
EasonGod: 號裡面那個應該是他的target執行緒,這樣解釋對嗎? 02/05 22:39
yupog2003: 這兩個網站說的意思跟我說的一樣喔 02/05 22:51
yupog2003: 我拿spec來說好了,英文寫的比較好 02/05 22:51
yupog2003: suspends execution of the "calling" thread until 02/05 22:52
yupog2003: the target thread terminates 02/05 22:52
yupog2003: 暫停calling thread的執行直到target thread結束 02/05 22:52
yupog2003: 而target thread就是第一個參數,在這裡就是tid1 02/05 22:53