semaphore
GATE CSE & IT · Synchronization · 1990-2016
Study anchor
Galvin — Operating System Concepts
Processes, scheduling, memory, files, deadlocks
Practice action
Start latest PYQPYQs in this concept
All concepts →Consider a non-negative counting semaphore $$S.$$ The operation $$P(S)$$ decrements $$S,$$ and $$V(S)$$ increments $$S.$$ During an execution, $$20$$ $$P(S)$$ operations and $$12$$...
Consider the procedure below for the Producer-Consumer problem which uses semaphores: semaphore n = 0; semaphore s = 1; void producer() { while(true) { produce(); semWait(s); addTo...
Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation (i.e., wait) on sem...
Barrier is a synchronization construct where a set of processes synchronizes globally i.e. each process in the set arrives at the barrier and waits for all others to arrive and the...
A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4 V (signal) operations were completed on this semaphore. The resulting value of the semaphore
Each process P i ,i=1.....9 is coded as follows Repeat P(mutex){ critical section } V(mutex) Forever The code for P 10 is identical except that it uses V(mutex) in place of P(mutex...
Semaphore operations are atomic because they are implemented within the OS