































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of process scheduling, including the states of a process (new, ready, running, waiting, and terminated), i/o-bound and cpu-bound processes, the process table, and scheduling policies such as round robin, first-come first-served, and shortest job first. It covers the concept of context switching and the differences between non-preemptive and preemptive scheduling.
Typology: Study notes
1 / 39
This page cannot be seen from the preview
Don't miss anything!
































brastius 636 % ps -e PID TTY TIME CMD 0? 0:17 sched 1? 0:08 init 2? 0:00 pageout 3? 112:48 fsflush 317? 0:00 xdm 218? 0:01 cron 248? 0:00 sendmail 57? 0:00 sysevent 72? 0:00 picld 140? 0:20 in.route 153? 2:17 sshd 158? 0:43 rpcbind
New Ready Running Waiting Terminated
Processes that are most of the time waiting for an event: mouse event, keyboard, Ethernet packet arrives etc. This type of processes spends most of its time in the waiting state. These processes are in ready/running state only for a short period of time: update mouse cursor after mouse movement show a character on the screen etc.
These processes need the CPU for long periods of time: Scientific/Numerical Applications Compiler/Optimizer Renderer Image processing These processes are often in the ready or running state Most applications are I/O bound
Process ID (PID) 0 1 2 3 4 5 MAX PID- . . . Each Entry Includes: PID: Index in process table -Command and args -List of memory mappings used by process -Owner -PC (Program Counter) -Registers -Stack pointer -List of Open Files -State (Wait, Ready, Running etc.)
From the user’s point of view, an OS allows running multiple processes simultaneously. In reality, the OS runs one process after another to give the illusion that multiple processes run simultaneously. The Process Scheduler is the OS subsystem that runs one process after the other and decides what process to run next. A Context Switch is the procedure used by the OS to switch from one process to another
(^) Non Preemptive Scheduling (^) Preemptive Scheduling
(^) More control on how the CPU is used. (^) Simple to implement.
(^) More robust, one process cannot monopolize the CPU Fairness. The OS makes sure that CPU usage is the same by all running process.
Most processes require periodic CPU time only for a short while: (^) CPU Burst (^) e.g., process an event, then return to waiting state Needs vary process by process The faster the needed CPU bursts are satisfied, the better the responsiveness of the OS. Average Completion Time: Average time a process waits for a CPU burst to be satisfied (until the task is completed)