首页 > 试题广场 >

Consider the same setting as t

[问答题]
Consider the same setting as the previous problem.Assume now that each philosopher requires three chopsticks to eat and that resource requests are still issued separately. Describe some simple rules for determining whether a particular request could be satisfied without causing
deadlock given the current allocation of chopsticks to philosophers.
.
推荐
When a philosopher makes a request for a chopstick, allocate the request if:
1)the philosopher has two chopsticks and there is at least one chopstick remaining,
2)the philosopher has one chopstick and there is at least two chopsticks remaining,
3)there is at least one chopstick remaining, and there is at least one philosopher with three chopsticks,
4)the philosopher has no chopsticks, there are two chopsticks remaining, and there is at least one other philosopher with two chopsticks assigned.
发表于 2018-03-18 22:15:24 回复(0)