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
- FIT3155: Advanced data structures and algorithms Assignment, MUM, Malaysia Write a program that implements a binary heap and binary search tree data structure to manage a list of job requests in a computer repair shop
- FIT1047: Introduction to Computer Systems, Networks and Security Assignment, MUM, Malaysia Briefly describe the columns displayed by the tool you use that relate to a) memory usage and b) CPU usage
- Human Ecology Thesis, MUM, Malaysia In the year 2001, the Global System of Mobile Telecommunication (GSM) was introduced into the Nigerian market
- Interior Architecture Essay, TU, Malaysia Explore the significance of either the mobile phone or social networking websites in the 21st Century
- BTW1042: Malaysian business law Assignment, MUM, Malaysia Discuss whether the elements required to form a legally binding contract exist between Ben and Tim
- Work Culture and Employee Performance Dissertation, MMU, Malaysia The problem being addressed in this study is the relationship between post-pandemic hybrid work culture and performance
- LAW 3711: Equity & Trusts II Assignment, IIUM, Malaysia Mee Lan left RM 3000 for the maintenance of aged and poor people at Gunung Ledang
- BNNS6433: The infection typically starts in the lower urinary tract as a urinary tract infection (UTI): Genitourinary & Endocrine Nursing Assignment, LUC, Malaysia
- PGBM150: Innovation Entrepreneurship & Technology Transfer Report, SU, Malaysia The assessment has been specifically designed to accommodate the students varying commercial knowledge and understanding of module content
- UGB372: Select a global hospitality and tourism organization of your choice, which must operate at a national: marketing in digital world Assignment, SU, Malaysia