Create your own
Lesson illustration

Understanding Long-, Medium-, and Short-Term Schedulers

Hello. In the previous lesson, you saw how a process alternates between CPU bursts and I/O waits: I/O completion makes a process ready, but only a scheduling decision lets it run. That distinction is the starting point here.

Operating systems make scheduling decisions at more than one level. Some decisions determine which work is allowed into the system at all; some control which processes remain resident in main memory; and some decide who receives the CPU now. By the end of this lesson, you should be able to identify the long-term, medium-term, and short-term scheduler from the decision it makes, its place in the process-state model, and how frequently it acts.


Three questions, three scheduler levels

The word scheduler can sound as though it always means “choose the next process for the CPU.” That is only the role of the short-term scheduler. The three scheduler levels make different decisions at different time scales.

SchedulerCore questionPrimary responsibilityTypical process-state effect
Long-term scheduler“Should this submitted job enter the active system?”Admission control: choose which jobs become processes eligible for executionNew becomes ready
Medium-term scheduler“Should this process remain in main memory and active right now?”Suspension and resumption: temporarily remove processes from memory pressure or overload, then later restore themReady or waiting becomes suspended; suspended process later resumes
Short-term scheduler“Which ready process gets the CPU next?”CPU selection: choose one runnable process from the ready queueReady becomes running

A compact way to remember the distinction is to focus on the object each scheduler manages:

  • The long-term scheduler manages the job population admitted to the system.
  • The medium-term scheduler manages the resident, active population in memory.
  • The short-term scheduler manages immediate CPU ownership among ready processes.

The terms long, medium, and short describe the time scale of decisions, not how long a process itself runs.

Read the following short set of slides for the formal definitions. It is particularly useful because it places admission, swapping, and CPU selection side by side.

Chapter 5: CPU Scheduling

Read the “Types of Scheduling” material and the later slides on each scheduler level. These establish the three distinct decisions before you connect them to process states.

In the “Types of Scheduling” section, read the three definitions. Then locate the slides headed “Long-Term Scheduler,” “Medium-Term Scheduling,” and “Short-Term(CPU) Scheduling.” Read their responsibilities, paying attention to the contrast between admission, memory management, and selecting from the ready queue.


Long-term scheduling: admitting work

A system may have more submitted work than it can sensibly run at once. For example, a university compute server might receive many batch jobs: simulations, data-processing tasks, and compilation jobs. The long-term scheduler, also called the job scheduler, decides which of those jobs to admit for processing.

In the simplified process-state model, it controls the transition from new to ready. Once admitted, the process has entered the set of active work that the OS intends to execute. It may wait in the ready queue, run, block for I/O, and eventually terminate.

The long-term scheduler therefore controls the degree of multiprogramming: broadly, how many processes the system admits to compete for processor time and other resources. Admitting too few processes can leave the CPU idle whenever the current processes all wait for I/O. Admitting too many can create excessive competition for memory, CPU time, files, and devices.

Its decisions can use relatively rich information, such as:

  • job priority or service class;
  • expected execution time;
  • memory demand;
  • expected I/O behavior;
  • available capacity and policy limits.

The goal is not simply to maximize the number of admitted jobs. A good admission decision keeps the system able to provide acceptable service to the processes already present.

Why workload mix matters

The CPU-bound and I/O-bound distinction from the previous lesson matters at this level. If every admitted job is strongly CPU-bound, many jobs may remain ready for long periods while one runs. If every admitted job is often waiting for I/O, the CPU may become idle whenever they all block simultaneously.

A balanced mix can help maintain useful overlap: while I/O-bound processes wait for devices or network responses, CPU-bound processes can use processor time. This is a policy consideration for long-term scheduling, not a guarantee that the OS can perfectly predict program behavior.

Long-term scheduling is usually infrequent. A job may run for minutes, hours, or longer, so admission decisions do not normally need to be repeated at every CPU time slice. Some general-purpose systems admit nearly every process immediately; in those systems, admission control is less visible. The responsibility remains important in batch systems, heavily loaded servers, containers, and managed compute platforms.


Short-term scheduling: choosing the next CPU user

The short-term scheduler, also called the CPU scheduler, makes the familiar immediate decision:

Of all processes that are ready to execute, which one should run next?

It selects from the ready queue. A process in the waiting state cannot be selected, because it lacks something required to proceed, such as disk data, a network reply, or user input.

Consider three processes:

  • is running but requests disk I/O and becomes waiting.
  • and are ready.
  • The CPU is now available.

The short-term scheduler chooses either or , according to the scheduling policy. Later in the course, you will use policies such as FCFS, shortest-job-first, priority scheduling, and Round Robin to make that choice explicit.

This scheduler runs very frequently. It may be needed when a process blocks for I/O, terminates, becomes ready, or loses the CPU at the end of a time slice. Because it operates so often, it must make its choice quickly; time spent deciding is time not spent executing useful work.

Scheduler versus dispatcher

The terminology is sometimes blurred, but the distinction is useful:

  • The short-term scheduler makes the decision about which ready process should run.
  • The dispatcher performs the handoff: it gives CPU control to the chosen process.

That handoff can involve saving the state of the prior process and restoring the state of the selected one. You will examine the dispatcher and context-switch cost in a later lesson. For now, keep the central responsibility clear: the short-term scheduler selects a ready process for immediate CPU execution.


Medium-term scheduling: suspending and resuming processes

The medium-term scheduler handles a problem the other two do not directly solve: a process may be admitted to the system but temporarily should not remain active in main memory.

The OS can suspend a process, moving enough of its execution state out of main memory that it is not currently available for CPU dispatch. Later, it can resume the process by restoring it to a runnable or waiting state in memory. This activity is traditionally associated with swapping.

There are two important suspended states:

StateMeaning
Suspended readyThe process has everything it needs except restored memory residency. It would be ready if resumed.
Blocked suspendedThe process is both suspended and waiting for an event, such as I/O completion.

The medium-term scheduler can suspend a ready process when memory is under pressure or when reducing the active process set would improve overall responsiveness. It can also suspend a process that is already waiting, since that process cannot use the CPU until its event occurs anyway.

A subtle but important case occurs when I/O completes for a blocked-suspended process:

  1. The I/O event completes.
  2. The process is no longer blocked on I/O.
  3. It becomes suspended ready, rather than ordinary ready, because it is still not resident and eligible for immediate dispatch.
  4. The medium-term scheduler must resume it.
  5. Only then does it enter the ready queue, where the short-term scheduler may select it.

This prevents a common mistake: I/O completion does not always mean a process can immediately run. If it remains suspended, it must first be restored to an active, resident state.

The Process State Diagram with Scheduler Levels shows these responsibilities across the lifecycle.

The diagram places long-term scheduling at admission from NEW to READY, short-term scheduling at selection from READY to RUNNING, and medium-term scheduling around suspension and resumption between ordinary and suspended ready or waiting states.

Notice the three scheduler boundaries in the diagram:

  • Long-term scheduling is near the transition that brings new work into the ready population.
  • Short-term scheduling is near the ready-to-running transition and the return of a preempted process to ready.
  • Medium-term scheduling surrounds suspended-ready and blocked-suspended states, reflecting its role in temporarily removing and restoring processes.

Medium-term scheduling is generally less frequent than CPU scheduling, because moving a process’s execution image between memory and secondary storage is far more substantial than choosing a ready-queue entry. It is usually more frequent than long-term admission decisions, hence the name medium-term.

Modern OS implementations may not expose a single component literally named “the medium-term scheduler,” especially with demand paging and sophisticated memory management. The conceptual role still matters: when the OS decides which processes should be temporarily inactive or restored under memory pressure, it is performing medium-term scheduling work.

Watch this focused explanation to reinforce the state transitions and the difference in invocation frequency.

Process State Transition Diagram and various Schedulers | Operating System

Jenny’s Lectures CS IT, “Process State Transition Diagram and various Schedulers,” connects each scheduler to the state diagram and explains why their decision frequencies differ.

Start with long-term scheduling for admission and the degree of multiprogramming. Continue through short-term scheduling and medium-term scheduling, mapping each role onto the diagram. Then watch decision frequency to consolidate why CPU selection happens most often, suspension decisions less often, and admission least often.


Trace one process through all three levels

Suppose a batch analytics job, , is submitted to a busy computing system.

  1. Submission and admission. exists as submitted work in the new or job pool. The long-term scheduler decides that the system has capacity and admits it. becomes ready.

  2. First CPU allocation. waits with other ready processes. When the CPU scheduler chooses , the dispatcher gives it the CPU, and becomes running.

  3. I/O wait. reads a large input file and blocks for storage I/O. It leaves running and enters waiting. At this point, the short-term scheduler can choose another ready process for the CPU.

  4. Temporary suspension. Memory pressure becomes high. Since is already waiting for I/O, the medium-term scheduler suspends it. becomes blocked suspended.

  5. I/O completion while suspended. The read finishes. is no longer waiting for the file, but it is still suspended, so it becomes suspended ready.

  6. Resumption. When memory capacity permits, the medium-term scheduler restores . It becomes ready.

  7. Another CPU allocation. The short-term scheduler eventually selects from the ready queue. It resumes its CPU burst.

  8. Completion. After its final CPU burst, terminates. The long-term scheduler may now admit another queued job to maintain the desired workload level.

The same process can therefore be affected by all three schedulers, but at different points and for different reasons. No scheduler duplicates another’s purpose.


Avoiding common confusions

“The scheduler always picks the CPU process.”

Only the short-term scheduler does this. The long-term scheduler picks which work enters the active system, while the medium-term scheduler suspends and resumes processes to manage memory and the active population.

“Ready means running soon.”

Ready means the process could run if selected; it does not promise immediate CPU access. The short-term scheduler must choose it over other ready processes.

“A blocked process should be scheduled so it can finish its I/O.”

A blocked process cannot continue executing its normal instructions until the required event occurs. The CPU scheduler chooses only ready processes. The device proceeds independently, and its completion may later make the process ready.

“Medium-term scheduling is another CPU algorithm.”

No. It does not decide which ready process gets the next time slice. It decides whether processes are suspended or restored, typically to manage memory pressure and the active degree of multiprogramming.

“An I/O device choosing a request is short-term scheduling.”

That is I/O scheduling, a separate decision about which pending device request should be served. It is related to system performance, but it is distinct from selecting the next CPU process.


A job-interview decision rule

When you are asked to classify a scheduling action, identify the decision’s immediate object:

If the OS is deciding…Name the scheduler
Whether to admit a submitted job or process into the active systemLong-term scheduler
Whether to suspend a process or bring a suspended process back into memoryMedium-term scheduler
Which ready process should receive the CPU nowShort-term scheduler

A concise interview-quality explanation is:

The long-term scheduler performs admission control and influences the overall degree of multiprogramming. The medium-term scheduler suspends and resumes processes to manage memory and the active resident set. The short-term scheduler selects one ready process to receive the CPU, so it runs most frequently and must be fast.


Key takeaways

The three scheduler levels answer different questions:

  • Long-term scheduling decides which submitted work is admitted, controlling the overall degree of multiprogramming.
  • Medium-term scheduling suspends and resumes processes, managing memory pressure and the resident active process set.
  • Short-term scheduling selects the next ready process for the CPU and therefore operates most frequently.
  • A process that finishes I/O while suspended becomes suspended ready, not immediately ready to run.
  • The scheduler’s decision and the dispatcher’s CPU handoff are related but distinct responsibilities.

Next, you will identify the operating-system events that trigger a scheduling decision, such as process termination, I/O requests, I/O completion, and timer-based preemption.

Can't find a good explanation? Sign up and we'll make it for you

Sign up