Practice mode Operating Systems

In the dining philosophers problem, what can happen if every philosopher picks up the left chopstick at the same moment?

Correct answer D. Deadlock, because each waits forever for the right chopstick

Explanation

If all five philosophers grab their left chopstick together, every chopstick is held and each waits for the right one, which a neighbour holds: a circular wait, so deadlock. Fixes include letting at most four sit at the table, picking up both chopsticks only when both are free, or having an odd-numbered philosopher pick up left first and an even one right first to break the cycle.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.