最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

operating system - Does Preemptive Scheduling Inherently Require Time Slices? - Stack Overflow

programmeradmin1浏览0评论

I'm studying operating systems and have encountered conflicting information about preemptive scheduling, specifically regarding SRT (Shortest Remaining Time) scheduling. My question focuses on whether time slices are fundamentally required in preemptive scheduling.

Specific Question

When implementing SRT scheduling and creating Gantt charts, if a process with a shorter remaining time arrives between time units:

Should we wait for the current time slice to complete before switching? Or should context switching happen immediately upon the new process's arrival?

What I've Found

I've found contradicting information from different sources:

Some sources say preemptive scheduling (including SRT) inherently requires time slices Others state that preemptive scheduling can operate at the clock cycle level without waiting for time slices

Example Scenario

Consider a scenario where:

Process P1 is running (remaining time: 5 units) At time 1.5, Process P2 arrives (remaining time: 2 units)

Should P2 preempt P1:

Immediately at time 1.5? Or wait until the next time unit (2.0)?

What I've Tried

I've consulted:

Multiple operating systems textbooks Online resources AI assistants

But I'm getting different answers from each source. Can someone clarify this with authoritative sources or practical implementation details?

发布评论

评论列表(0)

  1. 暂无评论