Re: [問題] Thread and Event的疑惑

看板C_and_CPP作者 (星空下的鮪魚)時間14年前 (2010/06/08 18:57), 編輯推噓3(302)
留言5則, 3人參與, 最新討論串2/2 (看更多)
http://msdn.microsoft.com/en-us/library/ms687032(VS.85).aspx The function modifies the state of some types of synchronization objects. Modification occurs only for the object whose signaled state caused the function to return. For example, the count of a semaphore object is decreased by one. 我猜是上面這一段吧, 他會修改某些synchronization objects的status, 也就是被signal後,造成該function return, 而他又修改了該synchronization objects的status。 我記得同樣是WaitForSingleObject... 丟給他CEvent和 event handle 行為也會不一樣… =___="" -- 或許人生是一段整合內在的自己 並尋求人間一點真情的過程吧 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.120.59.242 ※ 編輯: aecho 來自: 59.120.59.242 (06/08 18:58)

06/08 19:29, , 1F
我覺得很怪耶 他會同時進去印printf 但是他卻能不被中斷
06/08 19:29, 1F

06/08 19:29, , 2F
不會印到一半就換人印 這什麼道理...難道他能保證
06/08 19:29, 2F

06/08 19:30, , 3F
每個function call都會做到結束才換人嗎???他也沒解釋...
06/08 19:30, 3F

06/09 09:14, , 4F
沒解釋就當它是這樣了XD
06/09 09:14, 4F

06/09 10:36, , 5F
你可以在每個output中間放個sleep(0)看看 情況可能會不一樣
06/09 10:36, 5F
文章代碼(AID): #1C3Y7zEz (C_and_CPP)
文章代碼(AID): #1C3Y7zEz (C_and_CPP)