By: Eric Bron nli (eric.bron.delete@this.zvisuel.com), December 5, 2014 4:23 am
Room: Moderated Discussions
> This is why the monitor (mutex/condition variable) paradigm is so good:
I know it's just an issue of nomemclature but under Windows mutexes (CreateMutex/ReleaseMutex/WaitForSingleObject) are heavyweight and quite slow (context switch) that's why critical sections (EnterCriticalSection/LeaveCriticalSection) must be favored whenever the data is shared by threads in the same process and that you don't have to wait for several synchronization objects (i.e. WaitForMultipleObjects available for mutexes, not critical sections)
I know it's just an issue of nomemclature but under Windows mutexes (CreateMutex/ReleaseMutex/WaitForSingleObject) are heavyweight and quite slow (context switch) that's why critical sections (EnterCriticalSection/LeaveCriticalSection) must be favored whenever the data is shared by threads in the same process and that you don't have to wait for several synchronization objects (i.e. WaitForMultipleObjects available for mutexes, not critical sections)