🎓 BookMCQ
← Back to 5. Process Synchronization

📝 Dining Philosophers Solution Using Monitors in Process synchronization (36 MCQs)

Monitor-Based Control of Five Philosopher States

A monitor-based solution to the dining philosophers problem manages philosopher states and fork allocation within one synchronized construct. It maintains whether each philosopher is thinking, hungry, or eating and uses condition variables to suspend philosophers who cannot acquire both adjacent forks. Automatic monitor mutual exclusion protects state updates and prevents conflicting allocation decisions.

Why Independent Fork Locks Can Produce Deadlock

When each philosopher acquires one fork before requesting another, all five may hold one resource and wait indefinitely for their neighbours. A monitor coordinates fork eligibility instead of allowing uncontrolled partial acquisition. It checks both neighbouring states before granting permission to eat, preventing adjacent philosophers from eating simultaneously.

State Testing and Condition-Based Philosopher Admission

A monitor stores an array of philosopher states and a condition variable for each philosopher. When philosopher i becomes hungry, the monitor checks whether both neighbours are not eating. If they are available, i enters the eating state; otherwise, it waits. After eating, i changes state and tests whether either neighbour can proceed.

Allowing Non-Adjacent Philosophers to Eat Together

Consider five philosophers labelled P0 through P4. If P0 and P2 are both hungry while their neighbours are thinking, the monitor can permit both to eat because they require different forks. If P1 later requests entry, it must wait while either adjacent philosopher is eating. Releasing forks enables subsequent eligibility checks.

Deadlock Prevention and Possible Starvation

The monitor prevents the classic circular-wait arrangement by granting permission only when both required forks are available. It also allows non-adjacent philosophers to eat concurrently, improving resource utilisation. However, monitor mutual exclusion alone does not guarantee fairness. Repeatedly favouring certain philosophers can still starve another without a suitable waiting and admission policy.

Misconceptions About the Monitor-Based Solution

'Only one philosopher can eat at a time' is incorrect because non-adjacent philosophers may eat together. 'A hungry philosopher automatically receives both forks' is incorrect because neighbour states determine eligibility. 'Preventing deadlock guarantees bounded waiting' is incorrect because unfair signalling may still cause starvation.

Exam Focus: Tracing Philosopher States and Neighbour Tests

Draw the five philosopher states and identify the two neighbours checked before entry. Trace hungry, eating, and thinking transitions after each request and release. Questions may ask which philosophers can eat simultaneously, how condition variables prevent unsafe entry, or whether the chosen monitor policy guarantees deadlock freedom and bounded waiting.

Key Terms of Monitor-Based Dining Philosophers

  • Hungry - Philosopher requesting both forks.
  • Eating - Philosopher holding both required forks.
  • Thinking - Philosopher requiring no forks.
  • Neighbour - Adjacent philosopher sharing a fork.
  • Condition variable - Controls waiting for fork availability.
  • Monitor - Protects philosopher states and allocation.
12
Easy
12
Medium
12
Hard

📝 All Dining Philosophers Solution Using Monitors in Process synchronization MCQs

Q1. In the monitor-based dining solution, what does the HUNGRY state represent?

A.The philosopher has requested both adjacent forks but has not yet been admitted to eat ✅
B.The philosopher has acquired exactly one fork and is waiting for the other
C.The philosopher is currently eating while its neighbors wait
D.The philosopher has released both forks and is thinking
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: HUNGRY records a request for permission to eat, not ownership of one fork. The monitor later checks both neighbors and changes the philosopher to EATING only when admission is safe.

Q2. At initialization, what state should be assigned to every philosopher in the five-person monitor solution?

A.EATING, because all forks are initially available
B.THINKING, because nobody has requested the forks yet ✅
C.HUNGRY, so every condition variable begins with a waiter
D.A different state for each philosopher to avoid contention
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: No philosopher has requested food at startup, so every state begins as THINKING. HUNGRY is assigned only when pickup is called, while EATING records a successful admission decision for this initial configuration.

Q3. Which condition must test(i) verify before changing philosopher i from HUNGRY to EATING?

A.Both neighbors must be THINKING and philosopher i must already be EATING
B.Philosopher i must be THINKING and at least one neighbor must be HUNGRY
C.Philosopher i must be HUNGRY and neither adjacent philosopher may be EATING ✅
D.Both neighbors must be HUNGRY, regardless of their current states
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The admission predicate requires state[i] to be HUNGRY and both adjacent states to differ from EATING. A hungry neighbor does not occupy a fork, so THINKING is not required at the same time.

Q4. Why does the standard monitor solution maintain a separate condition variable self[i] for each philosopher?

A.To let every philosopher signal all other philosophers at once
B.To store the number of forks currently available at the table
C.To guarantee that a philosopher receives CPU time immediately after signaling
D.To suspend and later notify the particular philosopher whose fork request cannot yet be granted ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: A private condition variable identifies the philosopher that must wait when its neighbors are eating. When that philosopher becomes eligible, the monitor can signal its own waiting condition without waking unrelated philosophers.

Q5. Which statement correctly describes the safety rule enforced by the monitor?

A.Two adjacent philosophers must never be in EATING at the same time ✅
B.Only one philosopher in the entire system may eat at any moment
C.Two philosophers may eat together only when their indices are consecutive
D.A hungry philosopher must be admitted before a thinking philosopher can continue
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Each philosopher needs the two forks shared with its immediate neighbors. The monitor therefore excludes adjacent eaters, while allowing non-adjacent philosophers to eat concurrently when their fork sets do not overlap.

Q6. Which sequence correctly describes pickup(i) in the monitor solution?

A.Set THINKING, signal both neighbors, then acquire the monitor lock
B.Set HUNGRY, call test(i), and wait on self[i] only if the state is still not EATING ✅
C.Wait on self[i] first, then set HUNGRY after waking
D.Set EATING immediately, then test whether either neighbor is using a fork
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Pickup records the request by setting HUNGRY, then tests eligibility. If test does not grant admission, the philosopher waits on its condition variable; otherwise the EATING state lets pickup return without sleeping.

Q7. What should putdown(i) do after philosopher i finishes eating?

A.Keep state[i] as EATING until both neighbors have eaten
B.Set both neighbors to THINKING before releasing the forks
C.Set state[i] to THINKING, then test the left and right neighbors for admission ✅
D.Signal every condition variable without examining any philosopher state
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Changing i to THINKING represents release of its fork requirements. The monitor then checks both adjacent philosophers, because either may have become eligible after i stopped eating, and tests both neighbors before returning.

Q8. Why must the shared state checks and transitions execute inside the monitor's protected region?

A.So that every philosopher receives an identical eating duration
B.So that condition variables automatically retain signals forever
C.So that the operating system scheduler cannot preempt any philosopher
D.So neighboring requests cannot make admission decisions from overlapping, outdated state observations ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: The monitor serializes each check-and-transition operation. Without that protection, adjacent philosophers could both observe free neighbors before either state update becomes visible, then both enter EATING and violate safety within one synchronized operation.

Q9. There are five philosophers numbered 0 through 4. Using modular indexing, which philosophers are the left and right neighbors of philosopher 0?

A.P4 and P1, respectively ✅
B.P1 and P2, respectively
C.P3 and P4, respectively
D.P0 and P1, respectively
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The table is circular, so indices wrap around. For i = 0, left is (0 + 4) mod 5 = 4 and right is (0 + 1) mod 5 = 1; the boundary is not linear.

Q10. In a ring of five philosophers, what is the largest number that can eat simultaneously under the no-adjacent-eaters rule?

A.Five, because every philosopher has a separate condition variable
B.Two, because no three vertices of a five-cycle can be pairwise nonadjacent ✅
C.Four, because only one philosopher must remain thinking
D.One, because the monitor allows only a single EATING state globally
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The five-person ring has no set of three pairwise nonadjacent philosophers. Two non-neighbors can eat together, but every third choice touches one of them; therefore the maximum is two in the circular arrangement.

Q11. Philosopher P2 is HUNGRY while both neighbors are HUNGRY but neither is EATING. What does the monitor's basic test rule permit?

A.P2 must wait until both neighbors become THINKING
B.P2 must wait because HUNGRY neighbors reserve both forks
C.P2 may become EATING because neither neighbor currently occupies a fork ✅
D.P2 may eat only after all other philosophers become THINKING
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The safety predicate excludes neighbors that are EATING, not neighbors that are HUNGRY. Hungry philosophers are still waiting for admission, so P2 may enter when both adjacent states are non-Eating.

Q12. A student moves the neighbor checks outside the monitor, then locks only while setting state[i] to EATING. What flaw can result?

A.The state array becomes read-only after initialization
B.Condition variables will no longer allow philosophers to sleep
C.The monitor guarantees fairness but may reduce throughput
D.Two adjacent philosophers may pass stale checks and both commit an EATING state ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: The check and state update are one logical admission decision. If separated, neighbors can both inspect an old snapshot before either commits, allowing conflicting EATING states despite locking the final assignment.

Q13. A philosopher releases the monitor lock and only afterward registers itself as waiting. A neighbor can signal during that gap. Which property of condition wait prevents this lost-wakeup race?

A.The wait operation atomically registers the waiter and releases the monitor lock ✅
B.The wait operation permanently stores every signal as a counting permit
C.The waiting philosopher keeps the monitor lock until it wakes
D.A signal always preempts the current thread and runs the waiter immediately
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Atomic release-and-wait prevents a signal from occurring between lock release and waiter registration. The neighbor can either observe the registered waiter or the caller can continue after the condition becomes true.

Q14. The state vector is [P0=EATING, P1=HUNGRY, P2=THINKING, P3=THINKING, P4=THINKING]. P0 executes putdown(0). What should happen to P1 if its test is performed correctly?

A.P1 remains HUNGRY because it is adjacent to P0's former fork position
B.P1 becomes EATING because both P0 and P2 are now not EATING ✅
C.P2 becomes EATING automatically, even though it did not request food
D.All five philosophers become THINKING before any signal occurs
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: After P0 becomes THINKING, P1's neighbors P0 and P2 are both non-EATING. Since P1 is already HUNGRY, test(1) grants admission by setting P1 to EATING and signaling self[1] when the monitor evaluates P1.

Q15. A monitor trace records the number of philosophers in EATING at each moment: (time, count) = (0,0), (1,1), (2,2), (3,2), (4,1). What is the greatest observed concurrency?

A.Zero philosophers
B.One philosopher
C.Two philosophers ✅
D.Four philosophers
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The largest y-value in the supplied trace is 2, occurring at times 2 and 3. This matches the five-person ring's maximum simultaneous set under the no-adjacent-eaters constraint for this recorded execution.

Q16. A programmer writes test(i) so it sets state[i] to EATING before checking either neighbor. Which result is possible?

A.The philosopher is forced to remain THINKING forever
B.The condition variable becomes a mutex automatically
C.The monitor can no longer represent the HUNGRY state
D.Adjacent philosophers can be marked EATING without first proving that both required forks are available ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The EATING assignment is the admission grant and must follow the neighbor checks. Performing it first can make the state array claim resources are reserved even when an adjacent philosopher is already eating.

Q17. In test(i), why should the monitor set state[i] to EATING before signaling self[i]?

A.The state update reserves the required forks before the awakened thread can resume ✅
B.The signal operation itself checks both neighbors and changes their states
C.The waiting thread must acquire one fork before the signal is sent
D.The monitor lock is permanently transferred to the philosopher after signaling
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Setting EATING first records the admission decision while the monitor is protected. The signal then wakes the corresponding waiter, which can rely on the reserved state rather than racing to acquire forks again.

Q18. Under signal-and-continue monitor semantics, what does a waiting philosopher generally need to understand after another philosopher signals its condition?

A.The signal transfers CPU ownership immediately and bypasses the scheduler
B.The signaling thread may continue, so the waiter resumes later through the monitor protocol; the prior EATING reservation must remain valid ✅
C.The condition signal permanently releases all forks at the table
D.The waiter can resume without reacquiring the monitor's synchronization protection
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: With signal-and-continue semantics, the signaled thread does not necessarily run immediately. The monitor must establish EATING before signaling and preserve that reservation while the waiter later reacquires protection according to the monitor's entry protocol.

Q19. Philosopher P2 changes from EATING to THINKING. Why does putdown(2) test both P1 and P3?

A.Because all philosophers must be awakened after every release
B.Because P1 and P3 are the only philosophers allowed to eat in the system
C.Because either neighbor may now have both required forks available and be waiting ✅
D.Because P2 must transfer one fork to each neighbor regardless of their states
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: P2 shares one fork with each adjacent philosopher. Its release can make either neighbor eligible, so the monitor tests both sides and signals each one whose HUNGRY state and neighbor conditions permit eating.

Q20. A reviewer changes the admission rule to require both neighbors to be THINKING, not merely not EATING. What is the likely effect?

A.It is necessary to preserve mutual exclusion in every five-philosopher ring
B.It allows a hungry neighbor to eat while sharing a fork
C.It guarantees all philosophers are admitted in numerical order
D.It can block safe admissions when a neighbor is HUNGRY but not using any fork, reducing concurrency unnecessarily ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: A HUNGRY neighbor has not entered the eating state and therefore does not currently occupy the shared fork. Requiring THINKING is stricter than the safety predicate and can reject valid concurrent admissions.

Q21. How does the monitor admission rule prevent the classic deadlock pattern in which every philosopher holds one fork and waits for another?

A.It grants permission for both required forks together or grants neither, so a philosopher never waits while holding one fork ✅
B.It forces all philosophers to acquire their left fork before their right fork
C.It lets a philosopher keep one fork while sleeping on its condition variable
D.It requires every philosopher to eat in a fixed circular order
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The monitor represents admission as one protected state transition rather than two independent fork acquisitions. A philosopher waiting in HUNGRY holds neither fork, so the partial-hold circular chain cannot form.

Q22. The state vector is [P0=EATING, P1=THINKING, P2=HUNGRY, P3=THINKING, P4=THINKING]. What happens when test(2) executes?

A.P2 must wait because P0 is eating, even though P0 is not its neighbor
B.P2 changes to EATING because P1 and P3 are both not EATING ✅
C.P0 is changed to THINKING to let P2 proceed
D.P2 and P3 both become EATING without checking their states
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: P2's immediate neighbors are P1 and P3, both THINKING in this trace. P0 is not adjacent to P2, so test(2) may safely set P2 to EATING while P0 continues eating.

Q23. A trace lists states in order P0,P1,P2,P3,P4: t0=(E,T,T,T,T); t1=(E,H,T,T,T); t2=(E,H,E,T,T); t3=(E,H,E,H,T); t4=(E,H,E,E,T). At which first time is the safety invariant violated?

A.t1, because a HUNGRY philosopher is next to an EATING philosopher
B.t2, because P0 and P2 are separated by one philosopher
C.t4, because P2 and P3 are adjacent and both are EATING ✅
D.t3, because two philosophers are HUNGRY simultaneously
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: HUNGRY does not violate the invariant; only adjacent EATING states do. At t4, P2 and P3 are neighbors and both EATING, whereas earlier rows contain no adjacent pair of eaters.

Q24. A monitor trace records the set of EATING philosophers at each moment: (0,{}), (1,{P0}), (2,{P0,P2}), (3,{P1}), (4,{P1,P3}), (5,{P4}). What does this trace demonstrate about concurrency?

A.The monitor always limits the system to one eater
B.The trace violates safety whenever two philosophers eat together
C.The monitor must admit five philosophers before any can eat
D.It permits two non-adjacent philosophers to eat concurrently while the trace never shows more than two eaters ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The trace reaches two simultaneous eaters at times 2 and 4, with pairs P0/P2 and P1/P3 non-adjacent. No listed state exceeds two eaters, so both observations fit the five-person monitor rule.

Q25. In a monitor that uses immediate-handoff signaling, test(i) signals self[i] before changing state[i] to EATING. Why is this order unsafe?

A.The awakened philosopher may run before the admission state is reserved and can observe that it is still not EATING ✅
B.The philosopher becomes THINKING before the signal is delivered
C.The monitor automatically changes both neighbors to EATING
D.The signal is converted into a permanent fork allocation for every philosopher
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: With immediate handoff, the waiter may resume as soon as signal occurs. If EATING has not yet been recorded, it can observe an ungranted request; recording the reservation first avoids this ordering flaw.

Q26. A helper checks that both neighbors are not EATING, releases the monitor, then later reacquires it and sets state[i] to EATING without rechecking. What is the central defect?

A.The monitor cannot store more than one philosopher state
B.The earlier eligibility result may be stale because a neighbor can become EATING before the later state update ✅
C.The helper must change every condition variable to a semaphore
D.The check is invalid because neighbors must always be THINKING
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: A neighboring philosopher can be admitted during the gap, invalidating the helper's earlier observation. The helper must perform the eligibility test and EATING transition together under the monitor's protection during the unlocked interval.

Q27. The five states are [P0=EATING, P1=HUNGRY, P2=THINKING, P3=HUNGRY, P4=THINKING]. If test(3) executes, what is the correct result?

A.P1 and P3 both become EATING because they are both hungry
B.P3 must remain HUNGRY because P0 is eating elsewhere in the ring
C.P3 becomes EATING, while P1 remains HUNGRY because P0 is eating next to P1 ✅
D.All philosophers become THINKING before test returns
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: P3's neighbors P2 and P4 are not EATING, so its request can be granted. P1 remains blocked because P0 is its neighbor and is still EATING; the two hungry requests differ in eligibility.

Q28. Before putdown(2), the states are [P0=T, P1=H, P2=E, P3=H, P4=T]. After P2 sets itself to THINKING and tests both neighbors, what can happen?

A.Only P1 can eat because the left neighbor is always checked first
B.Neither neighbor can eat until P0 also calls putdown
C.P1 and P3 cannot both eat because they are two positions apart
D.Both P1 and P3 can be changed to EATING because each has two non-EATING neighbors ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: After P2 becomes THINKING, P1 has neighbors P0 and P2 non-EATING, and P3 has neighbors P2 and P4 non-EATING. P1 and P3 are not adjacent, so both admissions are safe.

Q29. A philosopher is HUNGRY, while one neighbor is also HUNGRY but not EATING. The other neighbor is THINKING. What happens if the implementation incorrectly insists both neighbors be THINKING?

A.A safe admission may be delayed even though neither neighbor currently occupies a fork ✅
B.The philosopher is guaranteed to eat before every other philosopher
C.The monitor becomes unable to prevent adjacent philosophers from eating
D.The HUNGRY neighbor is automatically changed to EATING
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The actual safety condition only excludes EATING neighbors. Treating HUNGRY as if it already held a fork can reject a valid request, unnecessarily reducing concurrency and potentially worsening waiting time.

Q30. A philosopher remains HUNGRY through many rounds while other philosophers continue to eat. Which conclusion best distinguishes the monitor's guarantees?

A.The state invariant must have failed because any long wait proves adjacent eating
B.The solution may remain deadlock-free while still allowing starvation without a fair admission policy ✅
C.The monitor guarantees starvation freedom as soon as all state changes are protected
D.A condition variable automatically gives every waiter a bounded waiting time
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Deadlock freedom means the system avoids the circular blocking pattern; it does not ensure every request eventually wins. Without an explicit fairness policy and suitable scheduling assumptions, one philosopher may repeatedly be bypassed.

Q31. A putdown implementation sets state[i] to THINKING but calls test(i) again instead of testing i's two neighbors. What progress problem can result?

A.The philosopher that finished eating immediately re-enters EATING
B.Both forks are permanently removed from the table
C.An eligible neighbor can remain asleep because its condition was never tested and signaled ✅
D.The monitor necessarily allows adjacent philosophers to eat together
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The released forks can make the left or right neighbor eligible, not the philosopher that just finished. If neither neighbor is tested, a waiting request may receive no notification and remain blocked.

Q32. A trace records P0..P4 states: t0=(E,H,E,T,T); t1=(E,H,T,T,T); t2=(T,H,T,T,T); t3=(T,H,T,E,T); t4=(T,H,T,E,T). At which earliest point does P1 appear eligible but remain HUNGRY?

A.t0, because P1 is already HUNGRY
B.t1, because P2 has stopped eating even though P0 is still eating
C.t4, because the trace has ended
D.t2, because both P1's neighbors are no longer EATING but P1 was not admitted ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: At t2, P0 and P2 are both non-EATING, while P1 remains HUNGRY. The trace therefore indicates that putdown(0) failed to test or notify P1 after releasing P0's fork requirements in the recorded sequence.

Q33. Compared with unrelated per-fork locks, what is the principal structural benefit of this monitor-based solution?

A.It encapsulates philosopher states and admission procedures so their shared invariant is enforced at one synchronization boundary ✅
B.It removes the need to track whether a philosopher is hungry
C.It guarantees a deterministic order of eating on every execution
D.It lets a philosopher keep one fork while waiting for its second fork
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The monitor groups shared state and the procedures that update it, making the admission invariant easier to enforce consistently. This structure does not, by itself, guarantee fairness or starvation freedom.

Q34. A philosopher is correctly signaled after becoming eligible, but the scheduler never runs its ready thread. What can be concluded?

A.The monitor must repeatedly signal the philosopher until it executes
B.The monitor establishes eligibility but cannot guarantee execution without suitable scheduling progress ✅
C.The philosopher has already eaten because signal performs the eating operation
D.The condition variable has been permanently destroyed
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: A signal can make a blocked philosopher ready, but CPU execution remains controlled by the scheduler. Liveness therefore depends on scheduling progress and eventual completion by philosophers currently marked EATING.

Q35. With five philosophers indexed 0 through 4, a programmer computes the left neighbor as i-1 without wrap-around. What is wrong when i=0?

A.The left neighbor is philosopher 0 itself
B.The left neighbor is philosopher 1 because indices restart at zero
C.The expression produces -1 instead of the valid circular index 4, so the boundary case must use modular arithmetic ✅
D.The left neighbor is undefined because philosopher 0 has no neighbor
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The table is a ring, not a line. For i = 0, the left neighbor is (0 - 1 + 5) mod 5 = 4; a raw subtraction produces an invalid negative index.

Q36. In pickup(i), test(i) immediately changes state[i] to EATING and signals self[i], but no thread is waiting yet. What prevents pickup(i) from sleeping unnecessarily?

A.The condition variable stores the signal as a permanent permit
B.The monitor forces another philosopher to signal it again
C.The philosopher must always wait once before eating
D.Pickup checks state[i] after test and waits only if the state is still not EATING ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: The signal may have no waiter and therefore need not be remembered. Pickup avoids sleeping by inspecting the state after test; it waits only when admission was not granted and HUNGRY remains.

🔗 Related Topics (MCQs)