调度程序还提供了一种机制以支持交互进程
The scheduler provides one additional aide to interactive tasks: If a task is sufficiently interactive, when it exhausts its timeslice it will not be inserted into the expired array, but instead reinserted back into the active array.
调度程序还提供了一种机制以支持交互进程:如果一个进程的交互性非常强,那么当它的时间片用完后,它会被再次放置到活动数组而不是过期数组。
Timeslice recalculation is provided via the switching of the active and the expired arrays. Normally, as processes exhaust their timeslices, they are moved from the active array to the expired array. When there are no more processes in the active array, the two arrays are switched: The active becomes the expired, and the expired becomes the active. This provides O(1) timeslice recalculation. It also provides the possibility that an interactive task can become runnable but fail to run again until the array switch occurs because the task is stuck in the expired arra
The scheduler provides one additional aide to interactive tasks: If a task is sufficiently interactive, when it exhausts its timeslice it will not be inserted into the expired array, but instead reinserted back into the active array.
调度程序还提供了一种机制以支持交互进程:如果一个进程的交互性非常强,那么当它的时间片用完后,它会被再次放置到活动数组而不是过期数组。
Timeslice recalculation is provided via the switching of the active and the expired arrays. Normally, as processes exhaust their timeslices, they are moved from the active array to the expired array. When there are no more processes in the active array, the two arrays are switched: The active becomes the expired, and the expired becomes the active. This provides O(1) timeslice recalculation. It also provides the possibility that an interactive task can become runnable but fail to run again until the array switch occurs because the task is stuck in the expired arra

调度程序为交互任务提供了支持,当足够交互的任务用完时间片时,会将其重新插入活动数组而非过期数组,以实现O(1)时间片重新计算。该逻辑在scheduler_tick()中实现,通过定时器中断调用。决定进程是否重新插入到活动数组,考虑了任务的nice值和是否存在饥饿进程。
最低0.47元/天 解锁文章
409

被折叠的 条评论
为什么被折叠?



