- A key concept in all OSs is the process. A program does nothing unless its instructions are executed by a CPU. A program in execution, as mentioned, is a process.
- A process needs certain resources-including CPU time, memory, files, and I/O devices-to accomplish its task. These resources are either given to the process when it is created or allocated to it while it is running.
- When the process terminates, the OS will reclaim any reusable resources.
- Associated with each process is its address space, a list of memory locations from 0 to some maximum, which the process can read and write. The address space contains the executable program, the program's data and its stack. Also associated with each process is a set of resources, commonly including registers (program counter, stack pointer, ..), a list of open files, outstanding alarms, lists of related processes, and all the other information needed to run the program.
- In many OSs, all the information about each process, other than the contents of its own address space, is stored in a table called the process table, which is an array (or linked list) of structures, one for each process currently in existence.
- if a process can create one or more other processes (referred to as child processes) and these processes in turn can create child processes, we quickly arrive at the process tree structure of Fig. 2.26.
Figure 2.26:
A process tree. Process A created two child processes, B and C. Process B created three child processes, D, E, and F.
|
- Related processes that are cooperating to get some job done often need to communicate with one another and synchronize their activities. This communication is called interprocess communication.
- Each process has some set of addresses it can use, typically running from 0 up to some maximum. On many computers addresses are 32 or 64 bits, giving an address space of or bytes, respectively.
- A program by itself is not a process; a program is a passive entity, such as the contents of a file stored on disk, whereas a process is an active entity. A single-threaded process has one program counter specifying the next instruction to execute. The execution of such a process must be sequential. The CPU executes one instruction of the process after another, until the process completes.
- A multithreaded process has multiple program counters, each pointing to the next instruction to execute for a given thread.
- A process is the unit of work in a system. Such a system consists of a collection of processes, some of which are operating-system processes (those that execute system code) and the rest of which are user processes (those that execute user code). All these processes can potentially execute concurrently by multiplexing the CPU among them on a single CPU.
- The OS is responsible for the following activities in connection with process management:
- Creating and deleting both user and system processes,
- Suspending and resuming processes,
- Providing mechanisms for process synchronization,
- Providing mechanisms for process communication,
- Providing mechanisms for deadlock handling.
Cem Ozdogan
2011-02-14