交互式进程和批处理进程

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

调度程序还提供了一种机制以支持交互进程

    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 array. Reinserting inter
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值