首页 > 试题广场 >

Consider the dining-philosophe

[问答题]
Consider the dining-philosophers problem where the chopsticks are placed at the center of the table and any two of them could be used by a philosopher. Assume that requests for chopsticks are made one at a time. Describe a simple rule for determining whether a particular request could be satisfied without causing deadlock given the current allocation of chopsticks to philosophers.
.
推荐
The following rule prevents deadlock: when a philosopher makes a request for the first chopstick, do not satisfy there quest only if there is no other philosopher with two chopsticks and if there is only one chopstick remaining
发表于 2018-03-18 22:11:21 回复(0)