Scheduling: - Job Queue - Ready Queue - Device Queue - IPC Queue
Scheduling: - Job Queue - Ready Queue - Device Queue - IPC Queue
On a uniprocessor system there is only one process running, all others have to wait until they are scheduled. They are waiting in some scheduling queue:
Processes
Job Queue
Holds the future processes of the system.
IPC Queue
Holds the processes that wait for some IPC (inter process communication) event to occur.
Computer Architecture
WS 06/07
Scheduling
Processes
Ready queue
Tape
Disk
Terminal
registers
Computer Architecture
WS 06/07
Scheduling
From the job queue a new process is initially put into the ready queue. It waits until it is dispatched (selected for execution). Once the process is allocated the CPU, one of these events may occur.
Processes
Interrupt
The time slice may be expired or some higher priority process is ready. Hardware error signals (exceptions) also may cause a process to be interrupted.
I/O request
The process requests I/O. The process is shifted to a device queue. After the I/O device has ready, the process is put into the ready queue to continue.
IPC request
The process wants to comunicate with another process through some blocking IPC feature. Like I/O, but here the I/O-device is another process.
A note on the terminology: Strictly spoken, a process (in the sense of an active entity) only exists when it is allocated the CPU. In all other cases it is a dead body.
Computer Architecture WS 06/07 Dr.-Ing. Stefan Freinatis
Scheduling
Processes processes are ready process is running
Job queue
Ready queue
CPU
Interrupt I/O request events IPC request
Device queue
processes are waiting
IPC queue
Scheduling
The OS selects processes from queues and puts them into other queues. This selection task is done by schedulers.
Processes
Long-term Scheduler
Originates from batch systems. Selects jobs (programs) from the pool and loads them into memory. Invoked rather infrequently (seconds ... minutes). Can be slow. Has influence on the degree of multiprogramming (number of processes in memory). Some modern OS do not have a long-term scheduler any more.
Short-term Scheduler
Selects one process from among the processes that are ready to execute, and allocates the CPU to it. Initiates the context switches. Invoked very frequently (in the range of milliseconds). Must be fast, that is, must not consume much CPU time compared to the processes.
Computer Architecture WS 06/07 Dr.-Ing. Stefan Freinatis
Scheduling
Processes
Long-term scheduler
Short-term scheduler
Job queue
Ready queue
CPU
Scheduling
Sometimes it may be advantageous to remove processes temporarily from memory in order to reduce the degree of multiprogramming. At some later time the process is reintroduced into memory and can be continued. This scheme is called swapping, performed by a medium-term scheduler.
Job queue
Processes
Ready queue
swap out
CPU
Medium-term scheduler
swap in
swap queue
Computer Architecture
WS 06/07
Process Concept
Program in execution
Several processes may be carried out in parallel. Processes
Resource grouping
Each process is related to a certain task and groups together the required resources (Address space, PCB).
Process Management