Question

Dining Philosophers Problem: I need explanation with the following implementation Starvation? Deadlock? Spin lock Semaphore with queues

Dining Philosophers Problem:

I need explanation with the following implementation

Starvation? Deadlock?
Spin lock
Semaphore with queues
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

(a) if we implement dinning philosopher using locking protocol then suppose more than two philosophers are waiting for eating to get the chopstick all waiting philosopher is continuously checking the locks which cause busy waiting and as well as known as spin-lock but there is no chance of deadlock with the correct solution of dinning philosopher but there is chance of starvation because suppose if both philosophers are waiting and continuously checking the lock if philosopher 1 one get chance of getting chopstick then philosopher 2 still waits in spin-lock now again the recent philosopher willing to eat then again they will also check the lock now suppose philosopher 1 release chopstick then there might be chance that philosopher 3 will get chopstick but still philosopher2 in waiting for state such situation leads starvation but not deadlock.

b) The second solution is semaphore in queue order which will have neither deadlock nor starvation because semaphore has been introduced to get rid of a spinlock.

DEAR PLEASE DO RATE THE ANSWER IF HELPS ELSE LET ME KNOW YOUR DOUBTS IN COMMENTS (HAPPY TO HELP).

THANK YOU!!!

Add a comment
Know the answer?
Add Answer to:
Dining Philosophers Problem: I need explanation with the following implementation Starvation? Deadlock? Spin lock Semaphore with queues
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT