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 is difference between xp & 2003?
Differentiate between swapping and paging.
Explain Advantages and Limitations of a command line interface?
Explain process spawning?
Which is the best operating system in the world?
Can I use chkdsk on ssd?
What is pipelining in reference to ram?
What are the different types of fragmentation?
What are the benefits and losses of placing the functionality in a device controller rather than in placing it in the kernel?
What are the four necessary and sufficient conditions behind the deadlock?
How do I scan a usb drive for errors?
Define scheduling in OS.
Explain IPC?
Can chkdsk get stuck?
How can I tell if a program is 64 bit?