CS FundamentalsModerateCapgemini · Cognizant GenC
A counting semaphore S is initialised to 3. Five processes each execute wait(S) once, with no signal(S) in between. How many of them are blocked?
- A. 1
- B. 3
- C. 2
- D. 5
Correct answer: C. 2
The first three decrement S to 0 and proceed; the remaining two find S <= 0 and block.
More Operating Systems questions
- Numbering all resource types and requiring every process to request resources only in increasing order of number prevents deadlock by…
- Three processes with bursts 10, 5 and 8 ms arrive together at time 0 in the order P1, P2, P3 and are scheduled by Round Robin with a…
- Preemptive priority scheduling (lower number = higher priority) is used for P1 (arrival 0, burst 7, priority 3), P2 (1, 4, 1), P3 (2, 2…
- Processes P1 (arrival 0, burst 8), P2 (1, 4), P3 (2, 9) and P4 (3, 5) are scheduled by SRTF (preemptive shortest remaining time first)…
- Banker's algorithm: Available = (3, 3, 2). Allocation / Max for (A, B, C): P0 (0,1,0)/(7,5,3), P1 (2,0,0)/(3,2,2), P2 (3,0,2)/(9,0,2), P3…
- A system uses a two-level page table. A TLB lookup takes 10 ns, a memory access takes 100 ns and the TLB hit ratio is 80%. On a TLB miss…