Windows multi-threaded communication ---- through hidden windows
The default reactor of the Reactor framework under the Windows platform in the ACE frame is ACE_WFMO_REACTOR. If we build a console-based server application, we can use the ACE_WFMO_REACTOR class in the multi-thread. But recently, an ACE ACE is based on a ACE_WFMO_RAACTOR Class ACE_MSG_WFMO_REACTOR class based on a Windows window message mechanism. In this case, we are not uncommon --- uses the message mechanism by hiding the window in multithreading.
Everyone knows that the thread is divided into: user interface threads and workers threads, user interface threads are usually required to interact with users in the thread, derived from CWINAPP. The worker thread generally handles some background calculation work, starting the new thread through AfxBeginThread, does not participate in direct interaction with the user, even if there is also an indirect connection through the main thread. There is not such a significant difference in the SDK. For the operating system, there is no difference between the two, and there is more threads with interface (or display or hidden), including receiving a message queue, sending message queue, and auxiliary flag.
Too much nonsense and start to implement a thread synchronization and communication by hiding the window, steps below.
1. Register the window class in the main thread
---------------undone.