Nepedia
Back to Discover
Fluent Reader
💻

Scheduling (computing)

technology Maturity 7-9 war conflict Next article →

This article covers sensitive topics: war_conflict. Parents can manage visibility in Parental Controls.

Computers are amazing at doing many things at once. To do this, they use a system called scheduling. Scheduling is the way a computer assigns resources to different tasks. These resources might be the processor, network links, or expansion cards. The tasks being managed can be threads, processes, or data flows.

Thread pool
Thread pool

A special part of the system called a scheduler handles all this work. It makes sure the computer stays busy and works fairly for everyone.

A scheduler has many important goals to reach. One goal is to maximize throughput, which is the total amount of work finished in a certain time. Another goal is to minimize wait time or latency. Latency is the time from when a task is ready until it is actually finished. Schedulers also try to ensure fairness by giving equal time to different processes. Sometimes these goals conflict with each other. Because of this, the scheduler must find a good compromise.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

Operating systems use different types of schedulers to stay organized. The long-term scheduler, or admission scheduler, decides which jobs enter the system. It controls the mix of CPU-bound and I/O-bound processes. A CPU-bound process spends most of its time doing math and logic. An I/O-bound process spends more time doing input and output tasks. The medium-term scheduler helps by moving processes in and out of main memory. This process of moving things to secondary memory is called swapping.

Thread pool
Thread pool

The short-term scheduler, also known as the CPU scheduler, makes very fast decisions. It chooses which process in the memory gets to use the CPU next. This happens after things like clock interrupts or system calls. This scheduler can be preemptive, meaning it can forcibly stop a process. If it cannot stop a process, it is called a cooperative scheduler. A module called the dispatcher then carries out the actual switch. The dispatcher saves the state of the old process and loads the new one. This quick switch is known as dispatch latency.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

Schedulers use different rules, or algorithms, to manage their work. One simple rule is First-In, First-Out, or FIFO. This means tasks are handled in the exact order they arrive. This is very easy to do but can sometimes cause a convoy effect. This happens when one long task makes many short tasks wait. Other rules include priority scheduling, like Earliest Deadline First. This is used in real-time systems to make sure tasks meet their deadlines. These rules help everything from printers to large computer clusters run smoothly.

426 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (2)
File:Thread pool.svg
Thread pool.svg
File:Simplified Structure of the Linux Kernel.svg
Simplified Structure of the Linux Kernel.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.