interleaving
GATE CSE & IT · Synchronization · 2007-2024
Study anchor
Galvin — Operating System Concepts
Processes, scheduling, memory, files, deadlocks
Practice action
Start latest PYQPYQs in this concept
All concepts →Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially $a = 1$ and $b = 1$. Though context switching between threads can happe...
Consider the two functions incr and decr shown below. incr() { wait(s); X = X+1; signal(s); } decr() { wait(s); X = X-1; signal(s); } There are 5 threads each invoking incr once, a...
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 n...
Consider the following transactions with data items P and Q initialized to zero: T 1 : read (P) ; read (Q) ; if P = 0 then Q : = Q + 1 ; write (Q). T 2 : read (Q) ; read (P) if Q =...
When searching for the key value 60 in a binary search tree, nodes containing the key values 10, 20, 40, 50, 70 80, 90 are traversed, not necessarily in the order given. How many d...