Skip to content
Search

Linux:Kernel:Scheduling

lastmod 2023-02-28created 2015-03-076 edits

Multitasking

Multitasking operating systems use one of the following approaches.

  • Cooperative Multitasking
  • Preemptive Multitasking

Policy

The behavior by which the scheduler decides what to run and when. For optimization, processes are classified into the following two types.

  • I/O-bound processes: most GUI programs (they spend most of their time waiting for user actions through the keyboard or mouse.)
  • Processor-bound processes: programs that need a lot of mathematical computation, such as ssh-keygen and MATLAB.

Process priority

The Linux kernel has two separate priority ranges.

  • Nice value: -20 ~ +19 (Default 0): the larger the value, the lower the priority. Can be checked with the ps command.1 (meaning that the larger the value, the "nicer" the process is to other processes on the system)
  • Real-time priority: 0 ~ 99: the larger the value, the higher the priority. Implemented according to POSIX.1b. Can be checked with the ps command.2

Timeslice

A timeslice means that processor time is cut into slices and handed out to runnable processes.

Scheduler classes

Glossary

Preemption
Forcibly stopping a running process.

See also

Favorite site

References


  1. Can be checked with the NI value of ps -el. ↩

  2. Can be checked with the RTPRIO value of ps -eo state,uid,pid,ppid,rtprio,time,comm. '-' means it is not a real-time process. ↩