COBOL Manual for TNS/E Programs (H06.03+)
Process Initiation, Communication, and
Management
HP COBOL Manual for TNS/E Programs—520347-003
31-10
Example of Simple Interprocess Communication
To find the names of processes currently active, use the TACL command PPD.
NonStop systems maintain the list of process names in a destination control table
(DCT). The systems recognize the PPD command as a request for a tabulation of
information about named processes, not unnamed processes.
The report in Example 31-5 shows that the process-pair named $Z000 consists of a
primary process running in processor module 00 with the process identification number
(PIN) 022 and a backup process running in processor 01 with the PIN 021. The
processor and PIN of the process that started $Z000 (its ancestor) is 00,021. Notice
that not all processes are executing as process pairs—$DM00 and $DM01 (parts of
the Inspect symbolic debugger) are running as single processes.
Every disk volume name, device name, spooler collector name, and so on, begins with
a dollar sign. Each time you read from or write to one of them, you are reading from or
writing to the process controlling that entity.
Example of Simple Interprocess Communication
This example illustrates the principles of interprocess communication using named
processes and $RECEIVE (see Figure 31-4).
The program PITCHER accepts a line of text from its home terminal and transmits it to
the process $CATCH (the program named CATCHER). When it receives a line
beginning with the value “END,” PITCHER terminates after transmitting the line.
CATCHER displays each line on its home terminal. When the process that opened
CATCHER terminates, an HP COBOL run-time routine translates the closure as an
end of file (EOF) on $RECEIVE. The AT END phrase of the READ statement passes
control around the DISPLAY statement, the PERFORM terminates because its UNTIL
phrase is satisfied, and CATCHER terminates. (Use of an empty declarative would
eliminate the need for the END-TRANS paragraph and the AT END GO TO construct.)
Example 31-5. Report Produced by PPD Command
NAME PID1 PID2 ANCESTOR
$Z000 00,022 01,021 00,021
$CRT2 00,021 01,022 $Z000
$NULL 07,004 00,024 00,025
$CMON 07,005 00,026 00,025
$IMON 00,031 01,025 06,010
$DM00 00,032 $IMON
$DM01 01,024 $IMON
...










