跨線程send message

今天同事問了一個問題,說在線程中send message 和直接調用是否是同樣,他以爲是同樣的,可是線程跟蹤卻發現處理過程是在接收消息隊列完成。回家看到博客園上的一番爭論纔有些明白,這裏貼出來,共勉app

http://bbs.csdn.net/topics/390715501?page=1spa

If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, the system switches to that thread and calls the appropriate window procedure. Messages sent between threads are processed only when the receiving thread executes message retrieval code. The sending thread is blocked until the receiving thread processes the message..net

相關文章
相關標籤/搜索