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.
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
- Law of Equity Case Study, IIUM, Malaysia Consider a fictitious case involving Leo Pedersen and Calvin Pedersen. Beyond the facts of this case, there are two
- SEM207: Basic Econometrics Report, XUM, Malaysia Student is required to collect macroeconomic data of a nation that are relevant to explaining the country’s GDP
- MKT542: Channels Management Case Study, UiTM, Malaysia Write a conclusion paragraph that briefly informs the reader of what you wrote about in your review and your overall findings
- EGB10403:Intermediate Microeconomics Assignment, MU, Malaysia explain with a relevant example why is it important for a business
- BAC305: White Inc is a wholly 100% subsidiary to Malaysian company, Black Bhd: Company Accounting Reporting Assignment, WOU, Malaysia
- Bachelor of Economics Assignment, HU, Malaysia Students are required to look through the given articles in HLMS and choose one of the topics which they are comfortable
- Fast Mawar Bhd is a company that manufactures box mowers, It had net income of $ 15 million on revenues of $ 50 million last year: Financial Management, Case Study, UTM, Malaysia
- Financial accounting and Reporting 1 Report, UPM, Malaysia You have to select the latest annual report of any one of listed company in Malaysia
- BBPW3203 Financial Management II Pengurusan Kewangan II September 2024 Semester
- MER501: ENTREPRENEURSHIP Report, HU, Malaysia You will participate in the business model innovation (BMI) forums on LMS emphasizing discussions on “lean start-ups” and design thinking