edited by
21,410 views
14 votes
14 votes

Semaphores are used to solve the problem of

  1. Race Condition
  2. Process Synchronization
  3. Mutual Exclusion
  4. None of the above
  1. I and II
  2. II and III
  3. All of the above
  4. None of the above
edited by

11 Answers

0 votes
0 votes

getting rid of Race condition is not the primary purpose of Semaphore.  Semaphore mainly uses to avoid Busy waiting along with M.E. in C.S. to provide Sync.. so (B)

0 votes
0 votes
I believe the only answer to this is Process synchronization.
Mutual exclusion is a primary priority in the Process Synchronization therefore if Process synchronization is promised, then by default Mutual Exclusion will also be.
More over Mutual exclusion is the solution to the Race Condition.
Now the entire map goes like this: Process Synchronization -> Mutual Exclusion -> Race Condition.
Which basically means if process Synchronization is promised, everything would be guaranteed.

Now with Semaphores, Counting Semaphores enables concurrent use of the semaphore variable as a result of which the Mutual exclusion may not be delivered. However, The Binary Semaphores ensure the Mutual Exclusion.
Therefore for Mutex, Answer is Process Synchronization.
and for Couting, None of the Above.
Please let me know if the mistakes
–1 votes
–1 votes
Option A

Because we can't guarentee mutual exclusion in all cases.

If S is a counting semaphore initialized to 50 means ,there may be a chance of running 50 processes at a time.So it is not satisfying the mutual exclusion definition.
Answer:

Related questions

26 votes
26 votes
5 answers
1
Kathleen asked Sep 12, 2014
23,599 views
At a particular time of computation, the value of a counting semaphore is $7$. Then $20$ $P$ operations and $15$ $V$ operations were completed on this semaphore. The resu...
0 votes
0 votes
1 answer
3
Mrityudoot asked Jan 27
178 views
Can a counting semaphore acquire a negative value?S = 2;15 P operations done, should the semaphore be 0 or -13