a. Process Creation
Process 0 is created and initialized at system boot time but all other processes are created by a fork() or vfork() system call.
- The fork() system call causes the creation of a new process. The new (child) process is an exact copy of the calling (parent) process.
- vfork() differs from fork() only in that the child process can share code and data with the calling process (parent process). This speeds cloning activity significantly at a risk to the integrity of the parent process if vfork() is misused.
Processes terminate in one of two ways:
- Normal Termination occurs by a return from main or when requested by an explicit call to exit or _exit.
- Abnormal Termination occurs as the default action of a signal or when requested by abort.
When a process finishes executing, HP-UX terminates it using the exit system call.
Circumstances might require a process to synchronize its execution with a child process. This is done with the wait system call, which has several related routines.
During the exit system call, a process enters the zombie state and must dispose of child processes. Releasing process and thread structures no longer needed by the exiting process or thread is handled by three routines -- freeproc(), freethread(), and kissofdeath().
No comments:
Post a Comment