1. >GATE CS
  2. >Computer Science and IT Engineering
Found 2  QuestionsSET DEFAULT
Selected Filters
    GATE CS Computer Science and IT Engineering Synchronization
Exams
Years
Subjects
Topics

List of top Computer Science and IT Engineering Questions on Synchronization asked in GATE CS

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
Wait(A);
Print(*);
X = X+1;
If (X == 2)
{
Print($);
Signal(B);
}
Signal(A);
Wait(B);
Print(#);
Signal(B);
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?

  • GATE CS - 2026
  • GATE CS
  • Computer Science and IT Engineering
  • Synchronization

Consider a system consisting of 𝑘 instances of a resource 𝑅, being shared by
5 processes. Assume that each process requires a maximum of two instances of
resource 𝑅 and a process can request or release only one instance at a time. Further,
a process can request the second instance of the resource only after acquiring the
first instance.
The minimum value of 𝑘 for the system to be deadlock-free is ________. (answer
in integer)

  • GATE CS - 2026
  • GATE CS
  • Computer Science and IT Engineering
  • Synchronization