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 are the 10 different models of writing an addition program in C language?
why arithmetic operation can’t be performed on a void pointer?
Can static variables be declared in a header file?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
Here is a neat trick for checking whether two strings are equal
what will be the output for the following program? main() { char ch = 'k'; char c; printf("%c",c); }
main() { int a = 65; printf(“%d %o %x”,a,a,a); } Output 65 101 41 Please explain me.How it is coming like that?
What is void c?
What is a spanning Tree?
How do you list files in a directory?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
How can I sort a linked list?