CS FundamentalsHardGATE CS
A counting semaphore is implemented WITHOUT busy waiting, and its value is −3 at some moment. What does this tell you?
- A. Three processes are blocked on the semaphore's waiting queue
- B. Three more signal() calls are needed before any process may enter
- C. The semaphore has been corrupted, since values cannot be negative
- D. Three processes are currently in the critical section
Correct answer: A. Three processes are blocked on the semaphore's waiting queue
In the blocking implementation wait() decrements first and blocks if the value becomes negative, so −n means n waiters. In the busy-waiting textbook definition the value never goes below 0.
More Operating Systems questions
- Which statement about user-level threads in a many-to-one model is correct?
- A system has 4 instances of R1 and 2 of R2. Allocated: P1 holds 1 R1; P2 holds 2 R1 and 1 R2; P3 holds 1 R1 and 1 R2. Requests: P1 wants 1…
- Which statement about a process that calls exec() successfully is correct?
- A logical address space has 8 pages of 2 KB each, and physical memory has 32 frames. How many bits are in a logical address and in a…
- Reference string 1, 2, 3, 1, 4, 5, 1, 6, 2, 1, 3, 4 with 3 frames, initially empty. The clock (second-chance) algorithm sets a page's…
- TLB lookup 20 ns (done first), memory access 100 ns, single-level page table, TLB hit ratio 80%. In addition, 1 in every 1,000 memory…