Neil wrote:
Thanks Ehsan,
As the Winsock server application is a Dialog application, the PostMessages(..) post messages to the CDialog class, so I take it that its one thread recieving the messages? If so, how is the messages handled within a single thread, one message routine completes, before another one is processed?

I'm totally confused. At first it seemed that you're posting "thread messages" to your worker threads, but not it seems that you're posting messages to your main (GUI) thread.


The rule is simple: each thread handles only messages posted to it (or a window of which the message handler routine gets run under the context of that thread.) And the message handling happens one after another. IOW, a certain thread will not start processing another message once it's processing a message. Processing messages needs a message loop, so the only exception to the above rule is when the handling thread runs a message loop inside one of its message handlers (rare, but possible nevertheless.)

So there are 4 IOCP worker threads, which can all pass messages to the main CDialog class, so is it possible that two message handlers execute simultaneously?

If that's the case, and the CDialog message handlers don't run message loops of their own, then no.


--
Ehsan Akhgari
Farda Technology <http://www.farda-tech.com/>

Half the people you know are below average. --Steven Wright

_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to