Program in Execution
A process has a PCB
State
The state of a process is defined in part by the current activity of that process.
Jobs or Process?
Process or Program
Program | Process |
---|---|
Passive Entity | Active Entity |
Written in a specific language | The active program loaded in the memory |
Additional Library Files are to be linked to the program through a linker | The process is the final product of the program |
Loader loads the program into the memory by allocating some memory to turn it into a process | The program when loaded into the memory is called a process |
Single Thread Process
- Consists of a single program counter
- This Program counter points to the next instruction to execute
Multi-Thread Process
-
Consists of multiple program counters each belonging to a thread
- Serves the same purpose of pointing to the next instruction
Process Table
The process table is an array of PCB’s, that means logically contains a PCB for all of the current processes in the system
Process Control Block Vs Process Table
Types
Zombie Process
A process that has completed its execution but still has an entry in the process table, waiting for its parent process to read its exit status
What about the resources consumed by the Zombie Process?
Until the zombie process is reaped by the parent, it consumes only a small amount of memory for storing its process table entry and other essential information. However, it does not consume any CPU resources as it is no longer executing any code.
Orphan Process
What about the orphan process whose Parents are terminated?
The init process, usually identified as process ID 1, is the ancestor of all other processes in the system and serves as the ultimate parent process. It automatically becomes the parent of any orphaned processes (i.e., processes whose parent has terminated) and takes responsibility for reaping their exit statuses. This ensures that no zombie processes accumulate in the system.