Bird
Raised Fist0

If Peterson's algorithm is extended to more than two processes by using a turn array and flags, what is a key challenge that arises?

hard🎤 Interviewer Follow-up Q10 of Q15
Operating Systems - Critical Section Problem - Requirements & Peterson's Solution
If Peterson's algorithm is extended to more than two processes by using a turn array and flags, what is a key challenge that arises?
ADeadlock is impossible due to turn array
BEnsuring progress becomes difficult due to complex turn management
CBounded waiting is guaranteed trivially for all processes
DMutual exclusion is lost because flags cannot be maintained
Step-by-Step Solution
Solution:
  1. Step 1: Understand Peterson's algorithm extension

    Extending to n processes requires managing multiple turn variables and flags.
  2. Step 2: Analyze challenges

    Ensuring progress becomes complex because turn management must prevent circular waiting and starvation.
  3. Step 3: Evaluate other options

    Mutual exclusion can still be maintained with careful design, so B is wrong. Bounded waiting is not trivial, so C is wrong. Deadlock can still occur if turn management fails, so A is wrong.
  4. Final Answer:

    Option B -> Option B
  5. Quick Check:

    Progress guarantee is challenging with multiple processes [OK]
Quick Trick: Progress guarantee is hardest to maintain with many processes [OK]
Common Mistakes:
MISTAKES
  • Assuming mutual exclusion is lost
  • Believing bounded waiting is trivial
  • Ignoring deadlock possibility
Trap Explanation:
PITFALL
  • Candidates often underestimate complexity of progress and turn management in multi-process extensions.
Interviewer Note:
CONTEXT
  • Tests deep understanding of limitations when scaling Peterson's algorithm.
Master "Critical Section Problem - Requirements & Peterson's Solution" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes