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

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.