AdBrite

Your Ad Here

Thursday, April 21, 2011

Difference between Mutexes and Critical Sections

They are different synchronization mechanisms.  A mutex has thread affinity, a specific thread owns the mutex.  A critical section is "first-come-first-serve".  A critical section is not waitable like a mutex.  Calling WaitForSingleObject() for a mutex on the thread that owns it immediately succeeds.  If the mutex is owned by another thread, it won't return until the mutex is released.

No comments:

Post a Comment

BidVertiser

pocket cents

PocketCents Local Online Advertising