Tutorialspoint

1 Answer
David Meador
, 16 Views

Process Creation and Process termination are used to create and terminate processes respectively. Details about these are given as follows:

Process Creation

A process may be created in the system for different operations. Some of the events that lead to process creation are as follows:

  • User request for process creation
  • System Initialization
  • Batch job initialization
  • Execution of a process creation system call by a running process

A process may be created by another process using fork(). The creating process is called the parent process and the created process is the child process. A child process can have only one parent but a parent process may have many children. Both the parent and child processes have the same memory image, open files and environment strings. However, they have distinct address spaces.

A diagram that demonstrates process creation using fork() is as follows:

Process Creation using fork()

Process Termination

Process termination occurs when the process is terminated The exit() system call is used by most operating systems for process termination.

Some of the causes of process termination are as follows:

  1. A process may be terminated after its execution is naturally completed. This process leaves the processor and releases all its resources.
  2. A child process may be terminated if its parent process requests for its termination.
  3. A process can be terminated if it tries to use a resource that it is not allowed to. For example - A process can be terminated for trying to write into a read only file.
  4. If an I/O failure occurs for a process, it can be terminated. For example - If a process requires the printer and it is not working, then the process will be terminated.
  5. In most cases, if a parent process is terminated then its child processes are also terminated. This is done because the child process cannot exist without the parent process.
  6. If a process requires more memory than is currently available in the system, then it is terminated because of memory scarcity.

Advertisements