All about processes in OS!

How OS creates a process?

A process is actually a program that is currently under execution. Initially, a program stays on a disk.

So there are some steps involved in the creation of a process. These are:-

  1. Loading the program & static data to memory.
  2. Allocation of runtime stack. stack is a part of the memory used for local variables, function arg, etc.
  3. Allocation of the heap. This is used to allocate dynamic memory to the programs.
  4. I/O tasks such as I/P handle, O/P handle, and error handle.
  5. And at last OS hands-off to the main function.

Note:- Every process has a PCB(process control block). PCB is a data structure that stores all the basic information about a process.


The life cycle of a process.

From generation to termination a process undergoes a few steps or states. Those states are:-

  1. New state:- Whenever a program is getting converted into a process, it stays in the new state.
  2. Ready state:- Processes in this state are generally in the ready queue. These processes are waiting for their CPU scheduling.
  3. Waiting state:- The process which has some tasks such as I/O which would consume a bit more time, they are sent to the waiting state.
  4. Terminated state:- When a process has finished it's execution then it is finally sent to the termination state.

So these were basic knowledge about a process in OS.

Thanks for reading.

Subham Sharma

No alt text provided for this image

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics