Computer Sciences > GATE 2026 SET-2 > Operating System
Consider three processes P1, P2, and P3 running identical code, as shown in the
pseudocode below. A and B are two binary semaphores initialized to 1 and 0,
respectively. X is a shared variable initialized to 0. Each line in the pseudocode is
executed atomically.
Pseudocode of P1, P2, and P3
Assume that any of the three processes can start to execute first and context
switching can happen between these processes at any arbitrary time and in any
arbitrary order.
Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?
Pseudocode of P1, P2, and P3

Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?
Correct : a,b,c
Similar Questions
Consider the following five disk five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given tim...
Which one of the following CPU scheduling algorithms cannot be preemptive?
To keep track of free blocks in a file system, one of the two approaches is generally
used β using bitmaps (bit vectors) or using linked lists. Consider that...
Total Unique Visitors
Loading......