Back to the 2024 paper

Module 3: Inter-process Communication

20247m

What is Semaphore? Explain with algorithm the Dining-Philosophers Solution using Monitors.

Worked SolutionAI Assisted

Semaphore

Integer sync variable. Dining Philosophers with Monitor: monitor with 5 condition vars, state[] = thinking/hungry/eating, test(i) checks neighbors not eating, pickup puts hungry then test, putdown sets thinking then tests neighbors. Monitor ensures mutex, prevents deadlock/starvation vs semaphore solution with deadlock risk.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.