OS Process Termination Methods



There are four types of process termination methods in two different types, voluntary and involuntary. When the process terminates on its own then it is voluntary but if the process terminates due to a different reason then it is involuntary. Let’s discuss one by one in the following section.

Normal Exit (Voluntary)

Process will terminate because they have done their work. For example when a compiler has compiled the given program, the compiler executes a system call to tell the operating system that it is finished. This call is exit in UNIX and Exit Process in Windows. This will be a voluntary termination.

Error Exit (Voluntary)

This process termination occurs when the process discovers a critical error. For example if the user types the command, cc foo.c to compiler the program foo.c and if no such file exists, the compiler simply exits the program.

Fatal Error (Involuntary)

An error caused by the process will terminate the process. This is often due to a bug in a program. In some systems such as UNIX, a process can tell the operating system that it wishes to handle certain errors itself, in which case the process is signaled instead of terminated when one of the errors occurs.

UNIX: terminate, Windows: Try again

Killed by another process (Involuntary)

The process executes a system call telling the operating system to kill another process. This time the process should have the authority to kill another process.

UNIX: kill, Windows: Terminate process

No comments