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
- Business Analytics Research Paper, SU, Malaysia This project is proposed to solve the business problem from a business/firm/company perspective
- Genitourinary Case Study, IMC, Malaysia You are required to choose a case for a patient who suffered from a Genitourinary or Endocrine disease/disorder
- HRM581: Malaysian Employment Law Assignment, UiTM, Malaysia Mandy is a 20-year-old Malaysian employed as an Administrative Clerk at AMD Precision Sdn Bhd in Melaka
- ACC30008: You are required to analyse PN17 companies under Bursa KLSE 3 years (2017- 2019) during pre-pandemic COVID-19: Accounting theory Assignment, SUT, Malaysia
- SQQS5053:Applied Multivariate Data Analysis Assignment, UUM, Malaysia Show that the following matrix A is an orthogonal matrix Then, compute its eigenvalues and eigenvectors.
- PKK5901: To provide knowledge and experiences for students to plan and do research projects in the field of nutrition: Nutrition Dissertation Proposal, UPM, Malaysia
- EGB10403:Intermediate Microeconomics Assignment, MU, Malaysia explain with a relevant example why is it important for a business
- BAGB1013: What are FOUR (4) key performance metrics mentioned in the article that indicate the recovery: Principles Of Management Essay, UIU, Malaysia
- MPCF7113: Critically evaluate the business performance (for examples, sales, profit, production, and prospect): Corporate finance, Assignment 2, CU, Malaysia
- Safety, Health and Welfare Assignment, AMU, Malaysia What are the lessons we have learned in the past from handling Covid 19 Pandemic to prepare for any anticipated new outbreak