What is the difference between mutex and semaphore?
Answer Posted / rufus v. smith
A semaphore can be claimed a preset number of times, and when this number is reached, additional claims are blocked/denied until there is a release.
A binary semaphore has a count of 1. However, this does NOT make it a mutex.
A mutex is thread-aware. Once claimed, other claims (by other threads) will be blocked/denied. However, the same thread may claim it repeatedly and not be blocked (it must be released the same number of times).
For a binary semaphore, a second claim, even from the same thread, WILL block (not a good situation if from the same thread, make sure to timeout the request)
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is live boot?
What is storage management in operating system?
Tell me is windows nt a full blown object oriented operating system? Give reasons?
What is the purpose of an I/O status information?
List the sub-components of i/o manager in windows nt?
What is the difference between process and program?
What grep means?
Explain the concept of real-time operating systems?
What is a critical section?
Is it possible to have a deadlock involving only one process? Explain your answer.
What killed mandla maseko?
What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?
What are necessary conditions which can lead to a deadlock situation in a system?
Is vmware an operating system?
What are loosely coupled systems?