A process terminates when it finishes executing its final statement and asks the
operating system to delete it by using the exit() system call. At that point, the
process may return a status value (typically an integer) to its parent process
(via the wait() system call). All the resources of the process—including
physical and virtual memory, open files, and I/O buffers—are deallocated
by the operating system.
Termination can occur in other circumstances as well. A process can cause
the termination of another process via an appropriate system call (for example,
TerminateProcess() inWindows). Usually, such a system call can be invoked