Operating Systems/Process and Thread

From Wikiversity
Jump to: navigation, search

Process Life Cycle[edit]

Like in real world a process too is created and destroyed. Different operating systems have different life cycles for the processes but a very general life cycle model is given below.

Dormant[edit]

A dormant stage of the process is actually a program, executable file on hard disk.

Fork[edit]

A process is said to be forked when loaded in the main memory. The execution of instructions may not start immediately. The keyword fork is basically a Unix UNIX terminology.

Ready[edit]

A process is said to be ready when it can start executing the very next moment. Many times a process may need some resource which is not available for that time. Processes which can be scheduled to run at any time by a scheduler is said to be in ready state.

Blocked[edit]

A said to be blocked when it is waiting for some interrupt to occur. Without its occurrence it can not continue. Such processes are not considered by the scheduler for scheduling.

Running[edit]

The process which is currently being executed by the processor is called the running process. In an uniprocessor system there exist only one running process at a time.

Dead[edit]

A process is said to be dead or killed when its execution is complete. Such processes are then removed from the memory of a computer. A process might end for the following reasons.

  • It performed all the functions it was supposed to perform and ended normally
  • It created some exception and was killed by operating system
  • The parent of the process is killed.