Ensuring code runs synchronously
-
Is a crtical section a way of ensuring the your code runs synchrounsly as window message processing seems to take precedence in code execution
-
Is a crtical section a way of ensuring the your code runs synchrounsly as window message processing seems to take precedence in code execution
In Short, No! Critical Sections are Synchronisation Objects, It is of use only if your project is multi threaded,ie Has More than One thread running in the One Program. Each thread of your program, will wait in front of a CriticalSection where you try to Enter It, until all other threads leave it. It is a communal comunication deal between threads in a program. One thread of a program will not allow another thread to run, until the section is released. Other programs can switch thread in the mean time. The Nature and context of the question worries me! You seem to have to learn an awfull lot more before you are ready to discus critical sections :)
Bram van Kampen
-
Is a crtical section a way of ensuring the your code runs synchrounsly as window message processing seems to take precedence in code execution
No, It is NOT, and I explained that already! However, I also answered your other question, in quite a lot of detail. Before you can attempt to learn MFC Multi Threaded Programming, you will need to learn basic MFC Programming, and elements of the Windows SDK. MFC is a thin wrapper around the Windows SDK. Sometimes you need the real thing! Definitely needed in Multithreading. Cannot Help it, You need to study more before we can help you. Bram
Bram van Kampen