Process
Process
Example:
• A word-processing program being run by an individual user on a PC is a process
• A system task, such as sending output to a printer, is also a process
• The Process Control Block is the key tool that enables the OS to support
multiprocessing
• The significant point about the Process Control Block is that it contains sufficient
information so that it is possible to interrupt a running process and later resume
execution
• When a process is interrupted, the current values of the program counter and the
processor registers are saved in the appropriate fields of the corresponding PCB and
the state of the process is changed to some other values
Process Control Block (PCB)
A process can be uniquely characterized by a number of elements
• Program Counter: the address of the next instruction in the program to be executed
• Memory pointers: pointer to the program code and the data associated with this process
• Context data: these are data that are present in registers in the processor
• Accounting information: May include the amount of processor time and clock time used, time
limits
These list of information are stored in a data structure called a Process Control Block (PCB)
Process Control Block (PCB)
Process State
As a process executes, it changes state
• The term "context" refers to the data in the registers and program counter at a specific
moment in time.
• A program counter, also known as an instruction address register, is a small amount of fast
memory that holds the address of the instruction to be executed immediately after the
current one.
• In a switch, the state of process currently executing must be saved so that when it is
rescheduled, this state can be restored.
• When CPU switches to another process, the system must save the state of the old process
and load the saved state for the new process
Process Creation
• Operating systems need some way to create processes.
• Some of these are foreground process: processes that interact with the user and
perform work for them
• Background processes: not associated with particular users but, instead have
some specific function