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
Is it ok to interrupt chkdsk?
How do you tell if your os is corrupted?
Enumerate the different RAID levels.
How long does chkdsk f'r take?
Can I change from 32 bit to 64 bit?
Explain Marshalling?
Can you list the coffman's conditions that lead to a deadlock?
What do you mean by a zombie process?
Is atomic thread safe?
What is BSS(Block Started by Symbol)?
A pair of redundant systems are operating, how would you ensure that when one of them goes down, the other one will take over its operation?
Throw some light on internal process memory.
What does echo $$ do?
What is the dispatcher?
Explain what is meant by repetition of information and inability to represent information. Explain why each of these properties may indicate a bad relational database design.