Question
1) Implement clean, executable and effective C program for the following. Please ensure the code runs properly a)Implement the dining philosopher problem with C program:
1) Implement clean, executable and effective C program for the following. Please ensure the code runs properly
a)Implement the dining philosopher problem with C program: The problem: We have a certain number(n) of philosophers seated around a table, there are 3 states: eating, thinking and be hungry.
Constraints: -There are n forks. But for a philosopher to eat he needs 2 forks(1 left, 1 right) and when u are hungry u can only eat 1 cocoyam at a time.
-You are not supposed to impose to the philosophers how they have to think and the amount of time they have to think
-Don't impose to the philosopher how he is supposed to eat.
-One philosopher should not have for example 0 cocoyam while they others have more cocoyams.
-Each philosopher has two forks, both forks should be available for the philosopher to eat
-When he eats one cocoyam he drops the forks
The program should run and it should be effective.
b) Implement the multi level queue scheduling
c)write a program the split tasks amongst many processes (distributed programming).
I'll appreciate it if you don't use ai.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started