Question: Kindly Program this question by using only C Language ASAP. Thanks Put any space or anything else besides your SID in the file name. Q1)

Kindly Program this question by using only C Language ASAP. Thanks Putany space or anything else besides your SID in the file name.Kindly Program this question by using only C Language ASAP. Thanks

Put any space or anything else besides your SID in the file name. Q1) [20 Marks] [CLO9-PLO5]You implemented Dinning philosopher problem with 5 philosophers and 5 chopsticks as one of your LabTasks. Now consider a simpler situation with only two philosophers and two chopsticks. Both philosophers think for random 100.unt of 100,000 micro seconds) to eat. You may find following lines helpful. static pthread_mutext mutex1 = PTHREAD MUTEX INITIALIZER; pthread_mutex_lock (&mutex1) usleep(int); Because they think more, so it is possible, as shown in sample run below, that one philosopher might go into a long thinking phase and the other philosopher might eat mor than once during this time. But at no time there will be a deadlock. nadeem@nadeem-VirtualBox: ~/FA21/code/FinalLab$ /TwoPhilos.exe Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#2 wants to eat Philosopher#1 done eating, now thinking.... Philosopher#2 going to eat Philosopher#2 done eating, now thinking.... hilosopher#1 wants to eat hilosopher#1 going to eat ilosopher#1 done eating, now thinking..... Philosopher#2 wants to eat Philosopher#2 going to eat Philosopher#2 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#2 wants to eat Philosopher#2 going to eat Philosopher#2 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#2 wants to eat Put any space or anything else besides your SID in the file name. Q1) [20 Marks] [CLO9-PLO5]You implemented Dinning philosopher problem with 5 philosophers and 5 chopsticks as one of your LabTasks. Now consider a simpler situation with only two philosophers and two chopsticks. Both philosophers think for random 100.unt of 100,000 micro seconds) to eat. You may find following lines helpful. static pthread_mutext mutex1 = PTHREAD MUTEX INITIALIZER; pthread_mutex_lock (&mutex1) usleep(int); Because they think more, so it is possible, as shown in sample run below, that one philosopher might go into a long thinking phase and the other philosopher might eat mor than once during this time. But at no time there will be a deadlock. nadeem@nadeem-VirtualBox: ~/FA21/code/FinalLab$ /TwoPhilos.exe Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#2 wants to eat Philosopher#1 done eating, now thinking.... Philosopher#2 going to eat Philosopher#2 done eating, now thinking.... hilosopher#1 wants to eat hilosopher#1 going to eat ilosopher#1 done eating, now thinking..... Philosopher#2 wants to eat Philosopher#2 going to eat Philosopher#2 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#2 wants to eat Philosopher#2 going to eat Philosopher#2 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#1 wants to eat Philosopher#1 going to eat Philosopher#1 done eating, now thinking.... Philosopher#2 wants to eat

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!