ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU-(2020-2021)-1 > student homework > 2018529627020 JE >
HOMEWORK 7 Version 0
👤 Author: by kagenzaclaudiengmailcom 2020-11-10 06:22:57
Let me consider the deadlock situation that could occur in the dining-philosophers problem when the philosophers obtain the chopsticks one at a time

ANSWER

Deadlock is possible because the four necessary conditions

hold in the following manner:

1) mutual exclusion is required for chopsticks,

2) the philosophers tend to hold onto the chopstick in hand while they wait for the other chopstick

3) there is no preemption of chopsticks in the sense that a chopstick allocated to a philosopher cannot be forcibly

taken away,

4) there is a possibility of a circular wait.

 

Deadlocks could

be avoided by overcoming the conditions in the following manner:

1) allow simultaneous sharing of chopsticks

2) have the philosophers relinquish the first chopstick if they are unable to obtain the other chopstick

3) allow for chopsticks to be forcibly taken away if a philosopher has had a chopstick for a long period,

4) enforce a numbering of the chopsticks and always obtain the lower numbered chopstick before obtaining the higher-numbered one.

Please login to reply. Login

Reversion History

Loading...
No reversions found.