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 |
value = 0xabcd; for (loop = 1; (value >> 1) & 1 | loop & 1; loop++) { foo(); if (loop & 1) value >>= 1; } how many times is foo() executed?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
Explain do array subscripts always start with zero?
Can the sizeof operator be used to tell the size of an array passed to a function?
can we print any string without using terminator?
What does c value mean?
Why array is used in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
write a programme that inputs a number by user and gives its multiplication table.
Name the language in which the compiler of "c" in written?
what is the definition of storage classes?
code for replace tabs with equivalent number of blanks