Guardian Programmer's Guide

Table Of Contents
Managing Memory
Guardian Programmer’s Guide 421922-014
17 - 23
Attributes of Extended Data Segments
Attributes of Extended Data Segments
Normally, an extended data segment is private to the process that owns it, allows both
read and write access, and is created with its intended size. However, you can create
extended data segments with special properties that permit them to be:
Extensible, allowing dynamic allocation of disk space to the swap file
Shared with another process on the same CPU
Read-only, to keep the contents from being altered, which permits sharing across
CPUs
The following paragraphs describe the data segment attributes.
Extensible Data Segments
The system allocates extents to the swap file for an extensible data segment when
needed. Initially, the swap file might have no extents assigned to it for a private
extended data segment. If the data segment is to be shared, then one extent is initially
assigned to the swap file.
Shared Data Segments
For processes that share data, you can use shared data segments. You specify
sharing when allocating the segment. You can do so either by specifying the segment
ID of the segment and the PIN of an existing process you want to share data with or by
specifying the same swap file as an existing extended data segment. See Sharing an
Extended Data Segment, later in this section for details on how to do this.
Because the part of the shared data segment that is in memory can contain written
information that has not yet been copied to the swap file, you cannot share data
segments across CPUs. All processes sharing the same data segment must run on
the same CPU, unless the segment is read-only, as explained below.
Read-Only Data Segments
The contents of a read-only data segment cannot be altered and its data pages are not
copied to the swap file. Being read-only makes it possible to share segment contents
across CPUs.
Read-only segments cannot be extensible.
Allocating Extended Data Segments
To allocate an extended data segment, use the SEGMENT_ALLOCATE_ procedure.
Note. Most procedure calls with the “SEGMENT_” prefix return an error-detail parameter
as well as a return code in the error variable.