difference between semaphores and mutex?
Answer / selvakumar
"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 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 ? | 15 Yes | 2 No |
What does printf does?
ATM machine and railway reservation class/object diagram
a<<1 is equivalent to a) multiplying by 2 b) dividing by 2 c) adding 2 d)none of the above
What are the languages are portable and platform independent?Why they are like that?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?
what is a void pointer?
Why c is called a mid level programming language?
How will you delete a node in DLL?
Write a program to reverse a string.
0 Answers Global Logic, iNautix, TCS, Wipro,
How can you restore a redirected standard stream?
Can U write a C-program to print the size of a data type without using the sizeof() operator? Explain how it works inside ?