Jan 17, 2009

What's the difference between a mutex and a semaphore?

What's the difference between a mutex and a semaphore?
A mutex is owned by a thread/process. So once a thread locks it, then other threads/processes will either spin or block on the mutex. Whereas, semaphore allows one or more threads/processes to share the resource.
Mutex is binary semaphore

No comments:

Post a Comment