Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 4

Preemptive vs. Non-Preemptive Scheduling

Recommended resources

Hello! Welcome to the fourth lesson in our introductory module on scheduling theory.

In our last lesson, we explored the different objectives we might try to optimize in a scheduling problem, such as makespan, total completion time, and tardiness. Today, we will look at another fundamental characteristic specified in the β field of our α|β|γ notation: whether or not jobs can be interrupted once they've started.

This lesson addresses the learning outcome: Explain the difference between preemptive and non-preemptive scheduling. This distinction is not just a theoretical detail; it fundamentally changes how we can approach a problem and can even alter a problem's computational difficulty.

1. The Core Distinction: To Interrupt or Not to Interrupt

At its heart, the difference is simple:

  • Non-Preemptive Scheduling: Once a machine starts processing a job, it must continue until the job is fully completed. The job cannot be interrupted. This is the default assumption in many manufacturing and scheduling environments.
  • Preemptive Scheduling: A job currently being processed can be interrupted (preempted) and set aside. The machine can then start working on a different job. The preempted job can be resumed later, either from where it left off or after some setup.

This diagram provides a clear visual representation of the concept.

Preemptive Scheduling vs. Non-Preemptive Scheduling
This diagram shows two scenarios. In non-preemptive scheduling (right), Process 1 runs to completion before Process 2 can start. In preemptive scheduling (left), the system can interrupt Process 1 to run Process 2, and then switch back to complete Process 1.

As you can see, preemption allows for dynamic switching between tasks, while non-preemption enforces a "run-to-completion" policy.

To solidify these definitions and see how they are applied, let's watch a short video. It uses computer science terminology (e.g., 'CPU', 'process'), but the underlying logic is identical to scheduling jobs on machines.

Difference Between Preemptive and Non-Preemptive Scheduling

This video from About Technology provides a clear, narrated explanation of both scheduling modes and concludes with a helpful summary of their differences.

Please watch the following three segments: The definition of preemptive scheduling (from 01:39 to 02:57). The definition of non-preemptive scheduling (from 04:00 to 04:52). The final comparison of their characteristics (from 05:42 to 07:39).


2. Formalizing the Concept and Its Implications

In the α|β|γ notation, the presence of preemption is indicated by prmp in the β field. If prmp is not listed, the scheduling environment is assumed to be non-preemptive.

The choice between these two modes involves a critical trade-off:

  • Flexibility vs. Overhead: Preemption offers the flexibility to respond to urgent or high-priority jobs as soon as they arrive. However, this flexibility comes at a cost. In manufacturing, this "overhead" isn't just computational; it can involve physical setup times to switch between jobs (e.g., cleaning, retooling, or recalibrating a machine), which can be very expensive and time-consuming.
  • Optimality and Complexity: The most profound implication of preemption lies in its effect on problem complexity. A scheduling problem that is computationally "hard" (NP-hard) in a non-preemptive environment can sometimes become "easy" (polynomially solvable) if preemption is allowed.

Let's look at a concrete example from an academic resource.

Scheduling Problems and Solutions

This slide from a course on scheduling by Prof. Michael Pinedo and others starkly illustrates the impact of preemption on problem complexity for the Maximum Lateness objective (L_{max}).

Focus on the slide titled 'Maximum Lateness' (slide 52). Find the two key statements: '1 | r_j | L_max is strongly NP complete.' This is the non-preemptive single-machine problem with release dates to minimize maximum lateness. '1 | r_j, prmp | L_max can be solved by the preemptive Earliest Due Date (EDD) first rule.' This is the same problem, but with preemption allowed. The contrast between 'NP complete' and being solvable by a simple rule is the key takeaway here.

This is a powerful result. By simply allowing interruptions, a problem that is intractable for large instances becomes efficiently solvable. This happens because preemption gives the scheduler the freedom to immediately address a job that is about to become late, without being 'stuck' finishing a less urgent job that started earlier.


3. Preemptive Scheduling Rules

When preemption is allowed, we often use different scheduling rules that take advantage of this capability. These rules typically check at every decision point (e.g., when a new job arrives or a job completes) whether the currently running job is still the best one to be processing.

Some common preemptive rules include:

  • Shortest Remaining Processing Time (SRPT): This is the preemptive version of the Shortest Processing Time (SPT) rule. When a new job arrives, the scheduler compares its processing time to the remaining processing time of the job currently on the machine. If the new job is shorter, it preempts the current job. The video you watched referred to this as "Shortest Remaining Job First".
  • Preemptive Earliest Due Date (EDD): As seen in the reading, this rule is optimal for the 1 | rj, prmp | Lmax problem. At any point in time, the machine works on the available job with the earliest due date.
  • Longest Remaining Processing Time (LRPT): This is the preemptive version of the Longest Processing Time (LPT) heuristic. It is notable because it provides an optimal solution for the Pm | prmp | Cmax problem (minimizing makespan on parallel machines with preemption), further highlighting how preemption can lead to powerful, optimal algorithms.
Test your understanding!

Imagine you are scheduling jobs on a single machine. At time t=0, Job A arrives.

  • Job A: Processing time , Priority = Low
  • Job B: Processing time , Priority = High

At time t=2, while Job A is running, Job B arrives.

Describe what happens from t=2 onwards in:

  1. A non-preemptive system where the highest-priority job is always chosen when the machine becomes free.
  2. A preemptive system where a high-priority job will immediately interrupt a low-priority job.

Draw a simple timeline for both scenarios showing which job is running at what time.

Show answer

1. Non-Preemptive Scenario:

  • At t=2, Job B arrives. However, since the system is non-preemptive, Job A cannot be interrupted.
  • Job A continues to run until it is finished. It started at t=0 and needs 10 units of time, so it finishes at t=10.
  • At t=10, the machine becomes free. It now chooses the highest-priority waiting job, which is Job B.
  • Job B runs from t=10 to t=14.

Timeline:
[ (Job A) -------------------- | (Job B) ---- ]
0 10 14

2. Preemptive Scenario:

  • At t=2, Job B (High Priority) arrives. Job A (Low Priority) is currently running.
  • The system immediately preempts Job A. At this point, Job A has completed 2 units of work and has 8 units remaining.
  • Job B starts running at t=2. It needs 4 units of time, so it finishes at t=6.
  • At t=6, the machine becomes free. The only waiting job is the remainder of Job A.
  • Job A resumes processing and runs for its remaining 8 units of time, from t=6 to t=14.

Timeline:
[ (A) -- | (Job B) ---- | (A, resumed) -------- ]
0 2 6 14

This exercise clearly shows how preemption allows the system to react immediately to the high-priority arrival, completing Job B much earlier than in the non-preemptive case.


Conclusion

You should now have a clear understanding of the fundamental differences between preemptive and non-preemptive scheduling.

Key Takeaways:

  • Non-Preemptive: A job, once started, runs to completion without interruption. This is simpler and avoids the overhead of switching tasks.
  • Preemptive: A running job can be interrupted to process another, more urgent job. This provides flexibility and can significantly improve performance for certain objectives (like minimizing lateness).
  • Impact: The choice to allow preemption is a major structural decision. It can change a computationally hard problem into an easy one, but it comes with potential real-world costs (e.g., setup times).
  • Relevance to Your Thesis: In the context of Flexible Job Shop Problems (FJSP), most standard models assume non-preemptive operations within a single machine. Preemption, if allowed, is a specific and important characteristic that must be explicitly modeled, often making the problem even more complex to represent and solve.

Preview of the next lesson: In this lesson, we encountered terms like "NP-complete" and "easy" problems. To properly understand what these mean and why they are so crucial for scheduling research, our next lesson will formally introduce the computational complexity classes (P, NP, NP-hard) relevant to scheduling. This will provide a rigorous foundation for classifying the difficulty of the problems you will face in your research.