Guardian Programmer's Guide

Table Of Contents
Managing Memory
Guardian Programmer’s Guide 421922-014
17 - 39
Sharing an Extended Data Segment
.
.
ERROR := ADDRESS_DELIMIT_ (@MY^EXT^DATA,
! low^address !,
HIGH^ADDR,
! address^descriptor ! ,
SEGMENT^ID,
ERROR^DETAIL);
IF ERROR <> 0 THEN CALL ERROR^HANDLER;
Sharing an Extended Data Segment
Processes that share data can choose to share extended data segments. You do this
by setting appropriate parameters in the SEGMENT_ALLOCATE_ procedure call.
There are two ways an application process can share segments:
Using the PIN method
Using the file-name method
The method you choose will depend on the information your process knows about the
process that originally allocated the data segment:
If your process knows the PIN of the process that allocated the extended data
segment and the segment ID that was allocated, then your process can use the
PIN method.
If your process knows the swap-file name that the other process assigned to the
extended data segment, then your process can use the file-name method.
The following paragraphs describe each method.
Using the PIN Method
Your process can use the PIN method to share an extended data segment with
another process if all the following are true:
Your process is in the same CPU as the process that allocated the extended data
segment.
Your process knows the PIN of the process that allocated the extended data
segment.
Your process knows the segment ID of the extended data segment.
Your process has any of the following:
The same process access ID as the process that allocated the data segment
Note. Processes that share extended data segments must be in the same CPU, unless the
segments are read-only, in which case they can be shared across CPUs.