|
|
Process Management Programmer's Guide: 900 Series HP 3000 Computer Systems > Chapter 2 Process Management TasksDeleting Processes |
|
MPE/iX provides intrinsics that enable your program to delete itself and/or other processes. You may wish to delete a process because:
When your program directs MPE/iX to delete a process, MPE/iX uses as algorithm to delete a process. When your program deletes a process, MPE/iX also searches for and deletes all of the process's descendants (children, grandchildren, and so forth ). In addition, the operating system accomplishes the following tasks:
The following sections describe how your program can delete itself and/or another process using these intrinsics:
Your program can call the TERMINATE intrinsic to delete itself. The following is an example of a TERMINATE intrinsic call:
MPE/iX deletes the process by following the algorithm described in "Deleting Processes". If your program has PH capability, it can call the KILL intrinsic to delete a child process. An example of a KILL intrinsic call is:
PIN specifies the Process Identification Number of the child process to be deleted from the system. MPE/iX deletes the process by following the algorithm described in "Deleting Processes". When your program has reached what you (the programmer) have defined as an error condition, you may wish to delete it from the system. In addition, you want to be notified that MPE/iX deleted the calling process in an error condition (aborted). The QUIT intrinsic accomplishes this task by:
The following is an example of a QUIT intrinsic call:
The NUM parameter is transmitted to $STDLIST as part of the abort message. You can use this number to assist you in determining the state of the calling process when the abort occurred. In a session, your Root CI remains active even after the entire program finishes. In a batch job, the job terminates as soon as the entire program finishes, unless the :CONTINUE command is in effect. Your program can call the QUITPROG intrinsic to abort your entire user process structure (all processes below the Root CI). The QUITPROG intrinsic functions similarly to the QUIT intrinsic. The only difference is that when your program calls QUITPROG, MPE/iX deletes the entire user process structure (not just the calling process, as is the case with QUIT). The following is an example of a QUITPROG intrinsic call:
The NUM parameter is transmitted as part of the abort message to the calling process's $STDLIST. You can use this number to assist you in determining the state of the calling process when the abort occurred. In a session, your Root CI remains active even after the entire program is aborted. In a batch job, the job terminates, unless the :CONTINUE command is in effect. |
|