Department of Computer Science
Course: CS 3725
Horizontal Bar

next up gif
Next: Process scheduling Up: Virtual Memory Management Previous: Page fault frequency replacement

The allocation of processes to the processor

In order for virtual memory management to be effective, the system must be possible to execute several processes concurrently, with the processor switching back and forth among processes.

We will now consider the problem of allocating the processor itself to those processes. We have already seen that, for a single processor system, if two (or more) processes are in memory at the same time, then each process must be able to assume at least 3 states, as follows:

active
-- processes is currently running

ready
-- process is ready to run but has not yet been selected by the ``scheduler''

blocked
-- the process cannot be scheduled to run until an external (to the process) event occurs. Typically, this means that the process is waiting for some resource, or for input.

Real operating systems require more process states. We have already seen a simplified process state diagram for the UNIX operating system; Figure gif shows a more realistic process state diagram for the UNIX system.

   figure5428
Figure: A simplified UNIX process state diagram

In the operating system, each process is represented by its own process control block (sometimes called a task control block, or job control block). This process control block is a data structure (or set of structures) which contains information about the process. This information includes everything required to continue the process if it is blocked for any reason (or if it is interrupted). Typical information would include:

In many systems, this space for these process control blocks is allocated (in system space memory) when the system is generated, and places a firm limit on the number of processes which can be allocated at one time. (The simplicity of this allocation makes it attractive, even though it may waste part of system memory by having blocks allocated which are rarely used.)

Figure gif shows a diagram of the process management data structures for an early UNIX system.

   figure5638
Figure: Process management data structurees for an early version of UNIX System 5


next up gif
Next: Process scheduling Up: Virtual Memory Management Previous: Page fault frequency replacement

Paul Gillard
Mon Nov 24 20:44:06 NST 1997