Unit 2 Process Management
Unit 2 Process Management
Introduction
Earlier there used to be only single-task performing systems. In this way, there used to be only one
process running at a time. And it had the freedom to utilise all the resources in the system. But today,
we have multitasking and multiprocessing operating systems, where more than one process runs at a
time.
This creates problems such as deadlock and multiple processes requesting for the same resource,
processor, or RAM space allocation to execute.
All these problems require a proper solution, and this instigates the operating system to carry out
processor management
What is a process?
A process is an active execution unit of a program that performs some action. An operating system has
the right to create, schedule, and terminate a process. There are four sections in a process:-
Text: holds the current activities represented by the value of Program Counter
Stack: holds temporary data such as local variables, functional parameters, return addresses,
etc.
The operating system controls a process by a block called Process Control Block (PCB). It is a type of Data
Structure that is maintained by the OS for storing the context of each process.
Process management involves tasks related to processing like creation, scheduling, termination,
deadlock, etc. The operating systems allocate resources that allow the process to exchange information.
It synchronizes among processes and safeguards the resources of other processes.
The operating system manages the running processes in the system and performs tasks like scheduling
and resource allocation
Process Attributes
Process Id: a unique identifier assigned by the operating system to each process.
Process State: there are a few possible states a process goes through during execution.
CPU registers: stores the details of the process when it is swapped in and out of the CPU, just like
the program counter.
I/O status information: shows information like the device to which a process is allotted and details of
open files.
CPU scheduling information: processes are scheduled and executed based on priority.
Accounting & Business information: information about the amount of CPU used and time utilities
like a job or process number, real-time utilised, etc.
Memory management information: information about the value of base registers and limit registers,
segment tables, and pages.
Process States
These are the states in which a process might go during its execution. Let us know more about them-:
New: a new process is created when a certain program is called up from secondary memory and
loaded to RAM.
Ready: a process is said to be in a ready state if it is already loaded in the primary memory/RAM for
its execution.
Paused (Waiting): at this stage, the process is believed to be waiting for CPU or resource allocation.
Blocked: at this stage, the process is waiting for some I/O operation to get completed.
Terminated: this specifies the time at which the process gets terminated by the OS.
Suspended: this state shows that the process is ready but it has not been placed in the ready queue
for execution.
Characteristics of a Process
A process has the following characteristics:-
Process State: A process can be in several states, some of them are ready, suspend wait, and
running.
Process Control Block: The PCB is a data structure that contains information related to a process.
These blocks are stored in the process table.
Resources: Processes request various types of resources such as files, input/output devices, and
network connections. The OS manages the allocation of these resources.
Priority: Each process has a scheduling priority. Higher-priority processes are given preferential
treatment and they receive more CPU time compared to lower-priority processes.
Execution Context: Each process has its own execution context, which includes the address of the
next instruction to be executed, stack pointer, and register values.