Neil Devlin wrote:
As I am using 2 processors, and having 4 threads in my IOCP. If for example 4 threads do a Postmessages with he same message,(for example the above message). When the system comes to execute the function 4 times, does it wait until one is finished before doing the next one? If not, suppose I am better doing a EnterCriticalSection(..) and LeaveCriticalSection(..) withn the routine?

Since all of the four function calls are executed in the same thread, they cannot be overlapped. IOW, they will execute one after another (with some possible time inbetween.)

Neil, I think you need to digest the above again. Unless you keep asking about critical sections just for your understanding, Ehsan's answer above is correct.


It appears from your messages that you alloc memory in your IOCP threads and then PostMessage that memory over to the thread the dialog is in. The dialog then reads the memory and deletes it. This being the case the memory has no chance of being used by two threads at the same time. A critical section is not needed in this situation.

/dev


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

Reply via email to