The dining – philosophers problem will occur in case of ____________

A. 5 philosophers and 5 chopsticks

B. 4 philosophers and 5 chopsticks
C. 3 philosophers and 5 chopsticks
D. 6 philosophers and 5 chopsticks

Explanation: 1. DefinitionOne-liner: It is a classical synchronization problem used to model the challenges of allocating multiple shared resources among several processes without causing deadlock. 2. Primary CausesDeadlock: Occurs when all philosophers pick up their left fork simultaneously, leaving no right forks available (Circular Wait).Starvation: Occurs when a philosopher is indefinitely unable to acquire both forks because their neighbors are constantly alternating eating and thinking.3. Key Solutions (Deadlock Prevention)Resource Hierarchy: Assign numbers to forks and require philosophers to always pick up the lower-numbered fork first.Limitation: Allow only $n-1$ philosophers (e.g., 4 out of 5) to sit at the table simultaneously.Asymmetric Strategy: Have even-positioned philosophers pick the right fork first and odd-positioned philosophers pick the left fork first.Atomicity: Use a Monitor or Semaphore to ensure a philosopher only picks up forks if both are available at the same time.

Occurrence: 0, System Administrator 2026

The dining – philosophers problem will occur in case of ____________ | 5 philosophers and 5 chopsticks | CSS, PMS, PPSC, FPSC, KPPSC, SPSC, ISSB and NTS Past Papers | Pakistan's Largest Online Past Papers Database

Leave a comment