Introduction to Process Management
Before to explain process management, it is important to explain the terms program and process.
Program vs. Process
Process is actually a program in running State. But the main difference between program and process is,
“Every Program which is written in Low or High level language like (Assembly, C++ and Java etc.) is called Program. When CPU executes any program then it becomes a process.”
In simple words we can say,
“A process is program which contains set of instructions to execute.”
CPU execute these instructions. A process may require lot of computer resources to execute these instructions like printer, memory etc.
If more than one processes request for same resource at the same time. Then deadlock may occur. To handle with such situations Operating System is used.
OS perform the following activities in Process Management
- Scheduling processes and threads on the CPU’s.
- Creating and deleting both system and user processes.
- Context switching (Suspending and resuming processes).
- Mechanisms for process communication.
- Mechanisms for process synchronization.
How Process Looks in Main Memory?
The following image shows a simple layout of a process inside main memory,
|The Stack contains the temporary data, such as function parameters, returns addresses, and local variables.|
|It is dynamically allocated memory to a process during its execution time.|
|It Contains the global and static variables.|
|It includes the current instructions represented by Program Counter. It also represents the contents of the processor’s registers.|
Operations on the Process
- Creation: OS creates the Processes through System call at secondary level.
- Scheduling: Selecting the process which is to be executed next, is known as scheduling.
- Execution: When the process is scheduled for the execution .Then CPU starts executing it.
- Deletion/killing: Once the process gets over then the OS will kill that process.