Bird
Raised Fist0

In which scenario is Peterson's solution most appropriate for managing access to a critical section?

easy🔍 Pattern Recognition Q11 of Q15
Operating Systems - Critical Section Problem - Requirements & Peterson's Solution
In which scenario is Peterson's solution most appropriate for managing access to a critical section?
AWhen exactly two processes need mutual exclusion without relying on hardware atomic instructions
BWhen processes require synchronization but can tolerate starvation
CWhen multiple processes (more than two) need to synchronize access to a shared resource
DWhen the system supports preemptive multitasking with priority-based scheduling
Step-by-Step Solution
  1. Step 1: Identify Peterson's solution scope

    Peterson's algorithm is designed specifically for two processes to achieve mutual exclusion without hardware support.
  2. Step 2: Analyze other options

    When multiple processes (more than two) need to synchronize access to a shared resource is incorrect because Peterson's solution does not scale beyond two processes. When processes require synchronization but can tolerate starvation is wrong because Peterson's solution guarantees bounded waiting, preventing starvation. When the system supports preemptive multitasking with priority-based scheduling is irrelevant since Peterson's algorithm is independent of scheduling policies.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Peterson's solution is a classic two-process synchronization algorithm without hardware atomic instructions.
Quick Trick: Peterson's solution = two-process mutual exclusion without hardware locks
Common Mistakes:
MISTAKES
  • Assuming Peterson's works for more than two processes
  • Confusing bounded waiting with starvation allowance
  • Believing hardware support is required
Trap Explanation:
PITFALL
  • Options A and C are tempting because candidates often generalize Peterson's solution beyond two processes or misunderstand starvation guarantees. Option D distracts by mentioning scheduling, which is unrelated.
Interviewer Note:
CONTEXT
  • Tests candidate's ability to recognize the correct use case for 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