By: Klimax (danklima.delete@this.gmail.com), December 5, 2014 5:47 am
Room: Moderated Discussions
Eric Bron nli (eric.bron.delete@this.zvisuel.com) on December 5, 2014 4:23 am wrote:
> > 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)
>
>
Or when one doesn't need cross -process synchronization.
> > 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)
>
>
Or when one doesn't need cross -process synchronization.