Operating Systems · Concurrency and Synchronization
Official IIT answer key · IIT Kanpur · Audited Aug 2026
GATE CSE 2015 Set 1 Q9 · NAT · 1 mark
P1 ( ) {
C = B - 1;
B = 2 * C;
}P2 ( ) {
D = 2 * B;
B = D - 1;
}
The number of distinct values that B can possibly take after the execution is ___________.Key concept
No account needed
Sit 5 related Concurrency and SynchronizationPYQs as a guest. We'll score the set and show which traps cost marks — sign in only if you want to save the run.
Topic notes
Concurrency and Synchronization is consistently evaluated through rigorous interleaving analysis, semaphore tracing, and correctness verification of mutual exclusion algorithms. Over the years, GATE tests whether candidates can systematically trace race conditions, identify potential deadlocks from mismatched semaphore wait/signal orders, and compute the bounds or exact sets of possible shared variable values under non-atomic operations. Recent papers heavily favor Multi-Select Questions (MSQs) requiring complete enumeration of all valid execution traces and program outcomes.
Full Concurrency and Synchronization guide →The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently. P1 ( ) C = B - 1; B = 2 * C; P2 ( ) D = 2 * B; B = D - 1; The number of distinct values that B can possibly take after the execution is …
Topic-wise GATE CS PYQs with verified steps
Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.
