一、进程调度
注意:
- 抢占式SJF中,如果两个作业剩余量一样:给的答案中的意思,下一个被选择调入的进程是下标小的那个,即先到的那个。也就是说这里没有像RR中那样维持着一个循环队列。
- 注意优先级调度的注释,比如这题中,说明了a smaller priority number implies a higher priority,意思就是“小数字代表着高优先级”!!!
- RR中有个循环队列,知道吧?最好写甘特图的时候画出来。
第三问哈,看见没,idle 空闲的,unit 单元,也就是说一个非抢占的SJF甘特图前两个时间段不能进行进程处理。那平均等待时间岂不是直接+2就ok?? 嗯。
二、进程同步问题
There is only one single-log bridge(独木桥) over the river connecting the west and the east.If there is some one on the bridge, people from other direction must wait until there is no person on the bridge.While if several people go the same direction,they can pass through at the same time. Write a code sketch for two kinds of people,people from west to east and people from east to west,w