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
Explain segmentation with paging?
What is the difference between ram and cache memory?
List the possible threads a thread can have?
What is lxde desktop?
What do you understand by the term ‘transistors’?
State the advantages of segmented paging over pure segmentation?
What is the purpose of an I/O status information?
How do I find my hidden files?
How much ram do I have?
Explain process.
What are different tasks of lexical analysis?
Why do we need inter process communication?
What do you mean by multithreading?
Explain Round Robin.
How does gcd work?