Classical mutual exclusion: Dekker’s algorithm guarantees mutual exclusion for how many processes that share a common critical section?

Difficulty: Easy

Correct Answer: 2

Explanation:


Introduction / Context:
Dekker’s algorithm is a landmark software-only solution to mutual exclusion on a single processor with shared memory and no special atomic instructions. Knowing its scope and limitations is part of understanding concurrency primitives and their evolution.


Given Data / Assumptions:

  • No modern hardware atomic instructions (like test-and-set) are assumed.
  • We are protecting a single critical section accessed by multiple processes.
  • Dekker’s original algorithm targets two processes specifically.


Concept / Approach:
Dekker’s algorithm uses intent flags and a turn variable to ensure mutual exclusion, progress, and bounded waiting for exactly two processes. Extensions and other algorithms (Peterson’s, Lamport’s bakery algorithm) address two or many processes differently, but Dekker’s classic form is for two.


Step-by-Step Solution:

Recall the structure: two boolean flags desire[i] and turn variable.Both processes coordinate by setting desire flags and yielding based on the turn.The proof of correctness holds for two participants; it does not generalize as-is to three or more.Therefore, the answer is two processes.


Verification / Alternative check:
Standard operating systems and distributed computing texts categorize Dekker’s algorithm as the first two-process mutual exclusion algorithm; multi-process solutions use other techniques.


Why Other Options Are Wrong:
1 is trivial and does not describe mutual exclusion. 3 or 4 require different algorithms or significant redesign. “None of the above” is incorrect because two is correct.


Common Pitfalls:
Confusing Dekker’s with Peterson’s algorithm (also two-process) or Lamport’s bakery algorithm (many processes).


Final Answer:
2

More Questions from Operating Systems Concepts

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion