658 views
1 votes
1 votes

It is given that in a system, processes P and C communicate by means of 3 semaphores and one buffer. The buffer size is given as 10. A semaphore M is used to implement mutual exclusion. Initial value of M is 1. 

The value of M is decremented by any process that wants to enter its critical region (the code that adds or removes items from the buffer), and incremented back to 1 after leaving the critical region.

The semaphore F counts the number of full slots in the buffer. It is initially 0, then it is decremented by C before entering its critical region, and incremented by P after leaving its critical region. Semaphore E counts the number of empty slots in the buffer. It is initially 10, then it is decremented by P before entering its critical region, and incremented by C after leaving its critical region.

Before entering a critical region, a process first tries to decrement E or F, and then tries to decrement M. On leaving a critical region, a process first raises M and then E or F. 

Under the given assumptions, consider the following combinations : 

 

  1. M = 0, E = 5, F = 3
  2. M = 0, E = 8, F = 0
  3. M = 0, E = 7, F = 1
  4. M = 1, E = 7, F = 0

 

Out of the four combinations given above, the total number of combinations which cannot exist is ____

1 Answer

1 votes
1 votes

4th option is incorrect because,

minimume sum of F+E can be 8  and maximume can be 10 in this question.

Related questions

3 votes
3 votes
1 answer
2
LRU asked Oct 17, 2021
593 views
Let S be a binary semaphore variable. Let S = 0 initially. Assume that no blocked processes exist in the system. The following signal (V), wait (P) operations are perform...
4 votes
4 votes
1 answer
3
LRU asked Oct 17, 2021
1,299 views
Consider the following statements : Satisfies Mutual exclusionSatisfies Progress Satisfies Bounded waitSuffers from deadlockThe number of above statements that is correc...
2 votes
2 votes
2 answers
4
LRU asked Oct 17, 2021
578 views
The solution for process synchronization is given below : Which of the following is correct about the above given solution? (A) Satisfies Mutual Exclusion(B) Satisfies ...