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's wrong with "char *p = malloc(10);" ?
Why is c still so popular?
What is the difference between formatted&unformatted i/o functions?
What is the advantage of a random access file?
to get a line of text and count the number of vowels in it
what is the hardware model of CFG( context free grammar)
write a c code "if you give a any decimal number then print that number in english alphabet"? ex: i/p: 552 o/p: five hundred fifty two ...
Write a C function to search a number in the given list of numbers. donot use printf and scanf
What are near, far and huge pointers?
0 Answers Hexaware, Thomson Reuters, Virtusa,
Does sprintf put null character?
Write an algorithm for a program that receives an integer as input and outputs the product of of its digits. E.g. 1234 = 24, 705 = 0
main() { intj; while9j<=10) { printf("\n%d",j); j=j+1; } }