[理工] 101交大OS thread

看板Grad-ProbAsk作者 (E神)時間8年前 (2017/02/05 22:20), 編輯推噓2(2011)
留言13則, 2人參與, 最新討論串1/1
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

02/05 22:28, , 1F
應該不是讓t1暫停,而是讓call pthread_join的thread
02/05 22:28, 1F

02/05 22:29, , 2F
暫停,等t1執行完了再繼續
02/05 22:29, 2F

02/05 22:34, , 3F

02/05 22:34, , 4F
這個是我查到的,他這樣說不是讓tid1先暫停嗎?
02/05 22:34, 4F

02/05 22:39, , 5F

02/05 22:39, , 6F
剛剛又看到這個,他說會等target thread執行完,所以括
02/05 22:39, 6F

02/05 22:39, , 7F
號裡面那個應該是他的target執行緒,這樣解釋對嗎?
02/05 22:39, 7F

02/05 22:51, , 8F
這兩個網站說的意思跟我說的一樣喔
02/05 22:51, 8F

02/05 22:51, , 9F
我拿spec來說好了,英文寫的比較好
02/05 22:51, 9F

02/05 22:52, , 10F
suspends execution of the "calling" thread until
02/05 22:52, 10F

02/05 22:52, , 11F
the target thread terminates
02/05 22:52, 11F

02/05 22:52, , 12F
暫停calling thread的執行直到target thread結束
02/05 22:52, 12F

02/05 22:53, , 13F
而target thread就是第一個參數,在這裡就是tid1
02/05 22:53, 13F
文章代碼(AID): #1ObpIWVI (Grad-ProbAsk)