A process can be defined as a program in execution which then forms the idea of all computation. the method isn't as same as program code buttons quite it. A process is an 'active' entity as against the program which is a 'passive' entity. Attributes held by the method include hardware state, memory, CPU, etc.
Process memory is split into four sections for efficient working:
- The Text section is formed from the compiled program code, read in from nonvolatile storage when the program is launched.
- The Data section is formed from the worldwide and static variables, allocated and initialized before executing the most.
- The Heap is employed for the dynamic memory allocation and is managed via calls to new, delete, malloc, free, etc.
- The Stack is employed for local variables. Space on the stack is maintained for local variables once they are declared.
The various Process States:
Processes within the OS are usually one of the given states:
- NEW- the method is being established.
- READY- the method is expecting to be allocated to a processor.
- RUNNING- Directions are being implemented.
- WAITING- the method is expecting some event to occur (such as an I/O completion or reception of a signal).
- TERMINATED- the method has finished execution.
Process Control Block
There is a Process Control Block for every process, enclosing all the knowledge about the method. It's also referred to as the task control block. it's a knowledge structure, which contains the following:
- Process State: It are often running, waiting, etc.
- Process ID and therefore the parent process ID.
- CPU registers and Program Counter. Program Counter holds the address of subsequent instruction to be executed for that process.
- CPU Scheduling information: like priority information and tips that could scheduling queues.
- Memory Management information: for instance, page tables or segment tables.
- Accounting information: The User and kernel CPU (central processing unit) time spent, account numbers, restrictions, etc.
- I/O Status information: Devices assigned, open file lists, etc.