CMSC 412

NOTE 1

Feb 27, 1999

Some Basic Concepts about Processes

A process is the execution of a sequence of instructions in some context. The context and sequence of instructions is specified by a program.

A computer system has both user processes and OS processes. A user process is the execution of a user program. A OS process is like a user process except that the program belongs to the OS code and the CPU executes it in OS mode.

At any time, a process is either executing or waiting for an event. The event can be an io completion, timer interrupt, external input, etc. It can be communicated at a low level, i.e., as a hardware interrupt, or at a higher level, i.e., as a "signal" from another process.

When a waiting process is to be restarted, there are two possiblities:

  1. The process is to be resumed in the state in which it was last interrupted. In this case, the "old state" of the process, i.e., the state just prior to being interrupted, needs to be saved in a OS data structure, typically called the PCB (process control block) of the process. The PCB can be in OS memory or in disk. We refer to such a process as a "pcb process".
  2. The process is to be restarted from a fixed (hence also initial) state that is stored in "read-only" memory or disk blocks. In this case, the old state of the process need not be saved, so there is no need to have a PCB for this process. We refer to such a process as a "nonpcb process".
Note: "pcb process" and "nonpcb process" are not standard terminology.

It is not possible for a computer system to have pcb processes and no nonpcb process as long as the OS and user processes share a cpu. This is because the execution of the code that switches the cpu from one pcb process to another pcb process is itself a nonPCB process.

A pcb process is in one of the following "states":