HPlogo Process Management Programmer's Guide: 900 Series HP 3000 Computer Systems > Chapter 2 Process Management Tasks

Suspending a Process (PH Capability Required)

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

If your program has PH capability, it can call the SUSPEND intrinsic to suspend itself. In addition, the CREATEPROCESS and ACTIVATE intrinsics also enable your program to suspend itself (explained below).

When a process suspends itself, it moves from an executing state to a suspended state. The process remains suspended until:

  • Another process calls the ACTIVATE intrinsic to reactivate it.

  • Another process (or MPE/iX) deletes it from the system.

When your program suspends itself, it must specify which processes have permission to reactivate it. You use the susp parameter to specify one of the following three conditions:

  • Only the parent process has permission to reactivate the suspended process.

  • Any child process has permission to reactivate the suspended process.

  • The parent process or any child process has permission to reactivate the suspended process.

Your program can optionally unlock a local Resource Identification Number (RIN) with the rin parameter of SUSPEND if it has the local RIN currently locked. Refer to the discussion of managing shared resources with RINs in Resource Management Programmer's Guide (32650-90024).

This is an example of a SUSPEND intrinsic call:


        .

        .

        .

   SUSP := 3;

   RIN := 3;

   SUSPEND (SUSP,RIN);

        .

        .

        .

The parameters specified in the example above are described below.

SUSP

Passes activation information. The value 3 specifies that the parent process and all child processes have permission to reactivate the process.

RIN

Passes a local RIN (3) that is unlocked when the process is suspended.

In addition, your program can suspend itself using:

  • The susp parameter of the ACTIVATE intrinsic

  • Item number 10 of the CREATEPROCESS intrinsic

When a non-zero value is specified for either parameter, your program is suspended when the specified process is activated. The value also indicates what processes have permission to reactivate your program after it had been suspended (in the same manner as the susp parameter of SUSPEND).

Feedback to webmaster