Dan Hipschman wrote:
I'm not sure this is a correct reason for mutexes instead of critical sections. Either way, you need to have a strict ordering so that you don't deadlock and critical sections use mutexes underneath. Unless you're going to be using a named mutex to synchronise across processes or you're going to have threads quit whilst holding the mutex, then the only difference will be that the code is slower when using mutexes because of the necessary server call, which more often than not can be avoided with critical sections.