文件名称:十字路口
介绍说明--下载内容来自于网络,使用问题请自行百度
有两条道路双向两个车道,即每条路每个方向只有一个车道,两条道路十字交叉。假设车辆只能向前直行,而不允许转弯和后退。如果有4辆车几乎同时到达这个十字路口,如图(a)所示;相互交叉地停下来,如图(b),此时4辆车都将不能继续向前,这是一个典型的死锁问题。从操作系统原理的资源分配观点,如果4辆车都想驶过十字路口,那么对资源的要求如下:
向北行驶的车1需要象限a和b;
向西行驶的车2需要象限b和c;
向南行驶的车3需要象限c和d;
向东行驶的车4需要象限d和a。
clipboard.png(There are two roads with two lanes, one lane in each direction of each road and two roads intersecting. Suppose that the vehicle can only go straight ahead without allowing for turning and backing. If four vehicles arrive at the intersection almost simultaneously, as shown in Figure (a), and stop at each other's crossroads, as shown in Figure (b), then all four vehicles will not be able to move forward, which is a typical deadlock problem. From the point of view of resource allocation based on operating system principle, if all four vehicles want to cross the intersection, the resource requirements are as follows:
The car that goes north needs 1 quadrants A and B.
Westward driving vehicle 2 requires quadrant B and C.
Car 3 to the South needs quadrant C and D.
4 of the cars to the East need quadrant D and a.
Clipboard.png)
向北行驶的车1需要象限a和b;
向西行驶的车2需要象限b和c;
向南行驶的车3需要象限c和d;
向东行驶的车4需要象限d和a。
clipboard.png(There are two roads with two lanes, one lane in each direction of each road and two roads intersecting. Suppose that the vehicle can only go straight ahead without allowing for turning and backing. If four vehicles arrive at the intersection almost simultaneously, as shown in Figure (a), and stop at each other's crossroads, as shown in Figure (b), then all four vehicles will not be able to move forward, which is a typical deadlock problem. From the point of view of resource allocation based on operating system principle, if all four vehicles want to cross the intersection, the resource requirements are as follows:
The car that goes north needs 1 quadrants A and B.
Westward driving vehicle 2 requires quadrant B and C.
Car 3 to the South needs quadrant C and D.
4 of the cars to the East need quadrant D and a.
Clipboard.png)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
十字路口.txt | 7043 | 2018-10-30 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.