Multithreading: Event Driven

Is there a performance difference in multithreading designed with win32 (CreateEvent) event objects or with a message queue in a thread window. Both should use some WaitFor calls .... My own code is almost entirely event based, but maybe I lose something when I don't use messages.

+3
source share
1 answer

If you are concerned about the performance difference between thread messages and kernel events, you probably shouldn't use threading messages.

Win32 thread message queues is a mechanism developed for Windows 16 when there were no threads. They grew up to handle the Win32 screw model, but under covers they are quite complex animals.

pro con. - , , . , Windows (MessageBox, DoDragDrop ..) - , . API- , . ** 1 * , , API- (GetMessage) ( QueueUserAPC).

' - - , . , , , - .

** 1 * , ASSERT, .

+4

Source: https://habr.com/ru/post/1725392/


All Articles