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
Briefly explain thrashing.
Is a directory a regular file?
WHATE IS DIFFERENT BETWEEN ANLOG , PLC & DCS OR EXPLAIN ANALOG / PLC / DCS SYSTEME
What is synchronously and asynchronously?
Can ram affect fps?
Explain the different types of fragmentation?
Can a 64 bit computer run 32 bit programs?
What are the different job scheduling in operating systems?
Define page fault interrupt?
What is normal operating system?
How can the FCFS scheduling be made better?
Explain briefly about compiler and its functioning?
Can a 64 bit run a 32bit program?
Give an example of Priority Inversion in Scheduling. What are the consequences of Priority Inversion?
What replaced ifconfig?