KT24403: Operating Systems Assignment, UMS, Malaysia There are N philosophers and N forks, the philosophers represent processes and forks represent resources
University | Universiti Malaysia Sabah (UMS) |
Subject | KT24403: Operating Systems |
The Dining Philosophers
There are N philosophers and N forks, the philosophers represent processes and forks represent resources
The philosophers are competing for forks and in order to eat, a philosopher needs 2 forks, one on the left and one on the right.
We need to prevent deadlock situations in cases where all philosophers are holding a fork and waiting to acquire another fork in order to be able to eat.
One of the simple rules we can implement to prevent deadlocks is to stop philosophers from taking up a fork if the other fork has already been taken by another process.
For example, if Philosopher 3 is ready to eat, he/she must have forks 3 and 4, but if fork 4 has already been taken by Philosopher 4 then Philosopher 3 cannot take up fork 3 and must wait for fork 4 to be available before it can take up both forks and eat.
Create a program to show the synchronization in this situation.
1. There are N philosophers and N forks Philosophers have 4 states, Thinking (Waiting), Hungry (Ready) Eating (Executing), and Exit (Terminate).
2. A philosopher can be in different states and the diagram below shows the changes in states from start to end.
Stuck in Completing this Assignment and feeling stressed ? Take our Private Writing Services.
Get Help By Expert
Explore a comprehensive academic support experience with our services at University Wawasan Open University (WOU). From TMA assistance to individual assignments and final year exam projects, we are your dedicated partner in achieving academic excellence. Our team of experts specializes in various subjects, including the challenging KT24403 Operating Systems Assignment at UMS, Malaysia. Looking for an exceptional Essay Writer in Malaysia? Look no further. We also offer a top-tier assignment writing service in Malaysia, tailored to your needs. Let us guide you towards success in your academic journey.
Recent Solved Questions
- CCP406: Rapid Application Development Assignment, HWU, Malaysia To develop a website using Rapid Application Development methodologies, tools, and technologies
- ECO211: Macroeconomics Assignment, UiTM, Malaysia How will the following situations affect the investment demand curve? Draw a diagram for each to illustrate
- ECO2103: Principles of Microeconomics Essay, IIU, Malaysia The global spread of covid-19 impacts all the industries throughout the world
- MPU3193: Explain with examples how metaphysical concepts influence our beliefs about the relationship between man and God in religion: Philosophy and Current Issues Assignment 2, WOU, Malaysia
- Positioning a brand effectively depends on aspects including the industry: Marketing Management, Essay, OUM, Malaysia
- Construction Law Essay, UCISS, Malaysia Company A was appointed by Syarikat T as the subcontractor for a project located in Selangor to complete the piling works
- D2FIN100: Introduction to Finance Assignment, HU, Malaysia Suppose the stock of Host Hotels & Resorts is currently trading for $20 per share. If Host does a 3:2 stock split
- Financial Assignment, TARC, Malaysia I know much money must be put into a bank account yielding 5% annually in order to have RM 250 at the end of five years
- Management Information Systems Report, AU, Malaysia To create a report and dashboard of sales analytics. Also, using the power bi technique, different customer types, product groups
- Leadership and Organizational Behavior Assignment, UiTM, Malaysia Which leadership approach/s would you personally employ or apply at work? why? This is an academic paper