CUET PG 2025 — Computer PYQ
CUET PG | Computer | 2025'The Dining Philosopher' problem can be solved by:
Choose the correct answer:
- A.
Use of semaphores
(Correct Answer) - B.
Use of overlays
- C.
Mutual exclusion
- D.
Bounded waiting
Use of semaphores
Explanation
Mathematical Logic for Deadlock Prevention
Agar hum resource hierarchy ya asymmetric method use karte hain, toh hum Circular Wait ki condition ko tod dete hain. Iska condition-based logic niche diya gaya hai:
1. Deadlock Condition (Simple Case):
Jab har philosopher i apni left chopstick utha leta hai, toh system deadlock mein phans jata hai:
2. Asymmetric Solution Logic:
Isme philosopher Pi ke liye logic badal diya jata hai:
Summary of Solutions:
-
Semaphores: Iska use chopsticks ko represent karne ke liye hota hai.
-
Waiters/Monitors: Shared resource ko control karne ke liye.
-
Limit occupancy: Sirf n−1 philosophers ko hi table par allow karna:
Limit=n−1
Sahi Jawab: Yeh problem Semaphores, Monitors, ya Asymmetric Resource Allocation se solve ki ja sakti hai.

