What is a Process
The most central concept in any operating system is the process — an abstraction of a running program. In hindsight, a program is a set of instructions written to perform a specific task.
Background
A process is essentially a program that is being executed. It is fundamental to the structure of OS. There are different ways it can be defined, but in general it is comprised of:
- A program code
- A set of data associated with that code
- A number of attributes describing the state of process
While the program is executing, this process can be uniquely characterized by a number of attributes:
- Identifier: A unique identifier associated with this process, to distinguish it from all other processes.
- State: If the process is currently executing, it is in the running state.
- Priority: Priority level relative to other processes.
- Program counter: The address of the next instruction in the program to be executed.
- Memory pointers: Includes pointers to the program code and data associated with this process, plus any memory blocks shared with other processes.
- Context data: These are data that are present in registers in the processor while the process is executing.
- I/O status information: Includes outstanding I/O requests, I/O devices (e.g. disk drives) assigned to this process, a list of files in use by the process, and so on.
- Accounting information: May include the amount of processor time and clock time used, time limits, account numbers, and so on.
The attributes are used by the OS to create the process control block, which will cover next.
Process Control Block