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?