QUESTION 37 Which of the algorithm(s) given below is/are NOT a type of contention-based...
Qualcomm technical mcq question, verified with a worked answer. Free to practise - no sign-up.
QUESTION 37
Which of the algorithm(s) given below is/are NOT a type of contention-based algorithms for mutual exclusion in operating systems?
I) Lamport's Algorithm
II) Suzuki-Kasami Algorithm
III) Ricart-Agarwala Algorithm
Show answer & explanation
Lamport's Algorithm (I) is a contention-based algorithm that uses timestamps and a queue to achieve mutual exclusion in distributed systems. Both Suzuki-Kasami Algorithm (II) and Ricart-Agarwala Algorithm (III) are token-based (non-contention) algorithms—they avoid busy-waiting by using explicit message passing and token circulation rather than competing for a shared resource. Therefore, (II) and (III) are NOT contention-based algorithms.
Step-by-step Derivation:
Contention-based mutual exclusion algorithms require processes to actively compete for a shared resource (like a lock or variable). Token-based algorithms avoid contention by having a single token that grants exclusive access.
• Lamport's Algorithm: Uses a logical clock and priority queue to order requests—processes contend for priority. This IS contention-based.
• Suzuki-Kasami Algorithm: Token-based; only one process holds the token at a time, preventing contention. This is NOT contention-based.
• Ricart-Agarwala Algorithm: Token-based; uses explicit request-reply messages and a single token holder. This is NOT contention-based.
Algorithms NOT contention-based: (II) and (III)
→ Answer: B