What is the difference between mutex and semaphore?
Answer Posted / mickey
Modified question is - What's the difference between A mutex
and a "binary" semaphore in "Linux"?
Ans: Compiled from above correct answers -
Following are the differences –
i) Scope – The scope of mutex is within a process address
space which has created it and is used for synchronization
of threads. Whereas semaphore can be used across process
space and hence it can be used for interprocess synchronization.
ii) Mutex is lightweight and faster than semaphore. Futex is
even faster.
iii) Mutex can be acquired by same thread successfully
multiple times with condition that it should release it same
number of times. Other thread trying to acquire will block.
Whereas in case of semaphore if same process tries to
acquire it again it blocks as it can be acquired only once.
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What do you mean by parallel processing?
What are the various capacities in which a ram is available?
Does ram affect excel performance?
How does thread synchronization occur in a monitor?
Does chkdsk delete files?
Is faster ram worth it?
What is the 4 layer model?
What are the functions of operating system?
What is starvation and aging?
Does 64 bit require uefi bios?
What do you mean by ram?
How you can detect deadlock condition?
Explain the difference between trap and trapdoor?
Stable storage cannot be implemented. (A) Explain why it cannot be. (B) Explain how database system deal with database applications
Differentiate between the user mode and monitor mode.