What is the difference between Mutex and Binary semaphore? - C++

Difference between Mutex and Binary semaphore.

Mutex is meant for mutual exclusion while Binary semaphore is meant for event notification and mutual exclusion. A binary semaphore is a simple "true/false" (locked/unlocked) flag that controls access to a single resource. Mutex can be released only by the thread that acquired it while semaphore can be released by any thread.

Difference between Mutex and Binary semaphore.

Semaphore synchronizes processes where as mutex synchronizes threads running in the same process.
What is the scope resolution operator? - C++
What is the scope resolution operator? - Scope resolution operator allows a program to reference an identifier in the global...
What are the advantages of inheritance? - C++
What are the advantages of inheritance? - Code reusability, Saves time in program development....
What is a conversion constructor? - C++
What is a conversion constructor? - It is a constructor that accepts one argument of a different type..
Post your comment