How a process is created, terminated and implemented explain in detail?
There are two basic operations that can be performed on a process: Creation and Deletion. They are explained as
1. When a new process is created, the operating system assigns a unique Process Identifier (PID) to it and inserts a new entry in the primary process table.
2. Then required memory space for all the elements of the process such as program, data, and stack is allocated including space for its Process Control Block (PCB).
3. Next, the various values in PCB are initialized such as,
4. Then the operating system will link this process to the scheduling queue and the process state would be changed from ‘New’ to ‘Ready’. Now the process is competing with the CPU.
5. Additionally, the operating system will create some other data structures such as log files or accounting files to keep track of process activity.
Processes are terminated by themselves when they finish executing their last statement, then the operating system USES exit( ) system call to delete its context. Then all the resources held by that process like physical and virtual memory, 10 buffers, open files, etc., are taken back by the operating system. Process P can be terminated either by the operating system or by the parent process of P.
A parent may terminate a process due to one of the following reasons:
Click here to submit your answer.