What is the difference between mutex and semaphore?
Answer Posted / henry denial s
"Mutexes are typically used to serialise access to a
section of re-entrant code that cannot be executed
concurrently by more than one thread. A mutex object only
allows one thread into a controlled section, forcing other
threads which attempt to gain access to that section to wait
until the first thread has exited from that section."
A mutex is really a semaphore with value 1
A semaphore restricts the number of simultaneous users of a
shared resource up to a maximum number. Threads can request
access to the resource (decrementing the semaphore), and can
signal that they have finished using the resource
(incrementing the semaphore)."
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What was microsoft's first operating system?
Where are the global variables stored?
Why partitioning and formatting is a prerequisite to installing an operating system?
Is 100 cpu usage bad?
What is the difference between ie and edge?
What is belady's anomaly?
Do hackers use mac or pc?
What is the difference between logical address space and physical address space?
What are necessary conditions for dead lock?
What is medium term scheduling in operating system (os)?
How do I stop chkdsk at startup?
What command is used to remove the password assigned to a group?
What is short term scheduler in operating system (os)?
State the advantages of segmented paging over pure segmentation?
Explain bootstrap program in operating system.