Two concurrent processes P1 and P2 use four shared resources R1, R2, R3 and…

GATE · 2005 · IT

Two concurrent processes P1 and P2 use four shared resources R1, R2, R3 and R4, as shown below.

image.png

Both processes are started at the same time, and each resource can be accessed by only one process at a time The following scheduling constraints exist between the access of resources by the processes:

  • P2 must complete use of R1 before P1 gets access to R1

  • P1 must complete use of R2 before P2 gets access to R2.

  • P2 must complete use of R3 before P1 gets access to R3.

  • P1 must complete use of R4 before P2 gets access to R4.

There are no other scheduling constraints between the processes. If only binary semaphores are used to enforce the above scheduling constraints, what is the minimum number of binary semaphores needed?  

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. D.

    4

Attempted by 55 students.

Show answer

Correct answer: B

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…