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?
A
**$#*#*#*
B
**$#*#*#*
C
**$#*#*#*
D
***$#*#*#*

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...
#276 MCQ
Which one of the following CPU scheduling algorithms cannot be preemptive?
#1568 MCQ
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...
#1599 Fill in the Blanks

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......