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 is include directive in c?
can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?
Is main() function predfined or userdefined?
what is the difference between #include<> and #include”…”?
What is the difference between exit() and _exit()?
What is the difference between constant pointer and pointer to a constant. Give examples.
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is a constant and types of constants in c?
write a program to fined second smallest and largest element in a given series of elements (without sorting)
Explain how do you determine whether to use a stream function or a low-level function?
we have a 3litres jug and a 5 litres jug and no measures on them. using these two jugs how can we measure 4 litres of water?