在单处理机系统中,采用先来先服务调度算法。系统中有四个进程,p1、p2、p3、P4(假设进程按此顺序到达)其中p1为运行状态,p2为就绪状态,p3和p4为等待状态,且p3等待打印机,p4等待扫描仪,若p1(请作答此空)。则p1、p2、p3和p4的状态应分别为( )。
2023-09-01
A.时间片到
B.释放了扫描仪
C.释放了打印机
D.已完成
参考答案:A
B.释放了扫描仪
C.释放了打印机
D.已完成
参考答案:A
本题部分信息比较隐晦,首先这里采用的是先来服务调度算法,即按照申请的顺序来安排运行,申请顺序已在题干假设为P1-P2-P3-P4.其次,单个空无法判断结构,那么结合第二空的选项来分析。首先不能2个进程同时运行,因此B选项排除;再根据原本P1-P2-P3-P4的状态分别是(运行、就绪、等待、等待),因此接下来能够在运行态的,要么是保持运行未改变的P1,否则应该是已经进入就绪态的P2(依据先来先服务的调度原则),由于第二空4个选项中,符合的只有C选项,因此这里应该选择C选项,此时P1-P2-P3-P4的状态分别是(就绪、运行、等待、等待)。据此再来分析第一空,P1由运行态转变为就绪态,条件应该是时间片到,所以选择A选项
![]( //img1.runjiapp.com/duoteimg/tiku/images/pc/questionBank/main-list-title-icon.png)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_69.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_34.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_16.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_88.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_61.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_68.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_9.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_92.jpg)
![](https://img1.runjiapp.com/duoteimg/tiku/banner/bn_40.jpg)
热门标签