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
Why do we need inter process communication?
Is excel for mac 64 bit?
How does thread synchronization occur in a monitor?
Can I change a 32 bit to 64 bit?
What is context in operating system?
What is a named pipe?
How does yahoo handles billions of requests, does it create a thread per request or a process?
Why are wait states used?
How long does chkdsk last?
What are the different functions of an operating system?
What is the cause of thrashing?
What is a Real Time Operating System? Elaborate.
What do you understand by multi-threading and multi-tasking?
When did 64 bit come out?
What causes a page fault?