A program in execution is called a process. There exist a number of process states, attributes of a process, state transitions in a process, etc. The process control block is also an important characteristic of a process. To read in detail, just scroll down.
What Is Process?
A process is a program in execution. It is the basic unit of resource allocation in an operating system. A process has a starting and ending point. It must execute and progress sequentially. A process is controlled and scheduled by the operating system.
An operating system executes different programs depending on the system. A program is a passive entity. It specifies the logic of data manipulation and I/O actions. A program does not perform the actions itself. A process is an active entity that uses system resources. It performs the actions specified in the program.
Attributes Of Process
Following are some important attributes of process:
- Program Counter
- Data Section
Program Counter: It is used to keep track of the address of the next instruction to be executed
Stack: stack is held the second position in the list of important attributes of the process. A stack is employed to store temporary data for the process
Data Section: A data section is employed that will contain global variables
Heap: A process might include a heap. It’s the memory that’s dynamically allotted throughout process execution.
Process states describe the character of current activity during a process. The state of a process changes because it executes. A method could also be in one in all the following states:
- Waiting (Blocked)
New: the method is being created and isn’t nevertheless in memory
Running: the method has an instruction that’s being executed
Waiting (Blocked): the method is expecting some event to occur
Ready: the method is waiting to be executed
Terminated: the method has finished execution and isn’t any longer in memory
States Transition in Process
Different state transitions during a process are as follows:
New -> ready: the method is admitted to ready queue and maybe thought-about by computer hardware scheduler
Ready -> Running: CPU scheduler chooses that process to execute next according to some planning algorithmic rule
Running -> Ready: the process has used its current time slice
Running -> Blocked: a process is expecting some event to occur like an I/O operation to be complete
Blocked -> Ready: the event has occurred that the process was waiting
Process Control Block
The process control block may be a data structure. It contains all data for a process to be used for controlling its execution. It additionally contains the data associated with the resource allotted to the process. Each method has its own PCB.
The process control block is incredibly vital. It ought to be kept in a protected space wherever the user cannot access it. The information that has got to be saved usually consists of the following:
Process State: It indicates the information regarding the process. The state will be ready, waiting, etc.
Program Counter: it points to the next instruction to be executed once the process gains the computer hardware.
CPU Register: the contents of the CPU register for the process. All the temporary data will be destroyed by the next process that gets the computer hardware after an interrupt happens.
CPU Planning: It holds data required for CPU scheduling, like process priority and any planning queue pointers
Accounting Data: This a part of PCB holds the amount of CPU time and real-time utilized by the process to date, the process range, and then forth.
I/O Status Information: This a part of the PCB holds a list of the I/O devices that the process has requested, a list of the process’s open files, etc.
|List of Open Files|
|4 Types of Optical Disks||Types of Mainframe System||3 Types of Data Processing|
|7 Types of Information Systems||What is Printer & Its Types||Database & Database Approaches|