Operating Systems · Question 15 · Hard

Operating Systems question 15

Two processes enforce mutual exclusion using only a shared variable turn (process i enters its critical section only when turn == i, and sets turn to the other process on exit). Which critical-section requirement does this strict alternation violate?

  1. Mutual exclusion
  2. Progress
  3. Bounded waiting
  4. None; it satisfies all three
Answer and explanation

Answer: B. Progress

Explanation: Strict alternation gives mutual exclusion, but a process cannot enter twice in a row even when the other process does not want the critical section. That violates progress. Peterson's solution fixes this by adding flag variables.

Previous: A TLB lookup takes 20 ns and a main-memory access takes 100 ns. On a TLB miss… · Next: The Banker's algorithm is used for which deadlock-handling strategy?

Practise operating systems

Try a fresh set of operating systems questions with an explanation after every answer, free and without signing up: Operating Systems practice. Or sit a full placement mock test.

More operating systems questions

More technical & programming practice

Computer Networks · Software Engineering · Cloud & DevOps · GenAI Basics · Pseudo-code · C Programming · Java · Python

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge