HP 3000 Manuals

Extra Data Segments (NM) (new) [ Introduction to MPE XL for MPE V Programmers Migration Guide ] MPE/iX 5.0 Documentation


Introduction to MPE XL for MPE V Programmers Migration Guide

Extra Data Segments (NM) 
(new) 

The demand-paged virtual memory scheme and the greatly expanded
addressing range of the 900 Series HP 3000 computer systems have
eliminated the need for extra data segments.

In NM, much larger data areas can be declared in your program than are
possible in MPE V/E or in CM. Also, your program can dynamically allocate
more data areas than is possible in MPE V/E or in CM. For example, use of
mapped files (discussed in Chapter 4, Accessing Files), or use of the NEW
procedure in Pascal XL, greatly expands the data area that the NM program
can directly access.

Data segment management (DS) intrinsics are not recommended for use in
the NM programming environment.  These intrinsics are provided in NM so
that you can recompile an MPE V/E program using NM compilers without
making source code changes.  Use of DS intrinsics in NM will degrade the
performance of your NM program.

Data Segment Management intrinsics continue to function in the CM
environment as described in the MPE V/E Intrinsics Reference Manual 
(32033-90007).

MPE XL Alternatives 

The following are examples of situations where extra data segments are
used in MPE V/E and suggested alternative approaches available in MPE XL.

Auxiliary Storage for Large Arrays.  In MPE V/E, extra data segments are
used to hold large arrays or tables that do not fit on the MPE V/E data
stack, because of the limited size (only 64K bytes) of the stack.

In MPE XL, the expanded addressing available allows NM programs to place
these arrays or tables in the data area simply by declaring them as
program variables.

Interprocess Communication.  In MPE V/E, extra data segments are used to
allow messages to be passed between processes running in the same
job/session.

In MPE XL, there are several alternative implementations available.  The
following, JCWs or CI variables and message files, are the two most
useful.

Job Control Words and/or CI Variables.  Short messages can be passed
between processes in the same job/session using Job Control Words (JCWs)
and/or Command Interpreter variables.  JCWs are somewhat changed from MPE
V/E and CI variables are a new feature on MPE XL. Values are written and
read using the following intrinsics:

          Table 14-1.  Interprocess Communication Intrinsics 
-----------------------------------------------------------------------------------------------
|                             |                               |                               |
|                             |             Write             |             Read              |
|                             |                               |                               |
-----------------------------------------------------------------------------------------------
|                             |                               |                               |
| CI Variables                | HPCIPUTVAR                    | HPCIGETVAR                    |
|                             |                               |                               |
-----------------------------------------------------------------------------------------------
|                             |                               |                               |
| JCWs                        | PUTJCW                        | GETJCW                        |
|                             |                               |                               |
-----------------------------------------------------------------------------------------------

Refer to the discussion on using JCWs in Interprocess Communication 
Programmer's Guide (32650-90019).  Refer to the discussion on the use of
variables and JCWs programmatically in Command Interpreter Access and 
Variables Programmer's Guide (32650-90011).

Message Files.  Message files are a special type of file with features
that make them ideal for managing messages between processes.  In
addition, message files allow processes in different jobs/sessions to
communicate with one another.

Refer to the discussion of using message files in Interprocess 
Communication Programmer's Guide (32650-90019).

Data Sharing Between Processes.  In MPE V/E, extra data segments are
sometimes used when two processes are sharing data (rather than passing
it to one another).  For example, a process builds a table of tax
information that another process uses to calculate tax withholding.

In MPE XL, shared files are strongly recommended for such a situation.
Refer to the discussion of sharing files in Accessing Files Programmer's 
Guide (32650-90017).

Startup Information for a Child Process.  In MPE V/E an extra data
segment is sometimes used when you need to pass information from a parent
process to a child process at process creation time.

In MPE XL, you can pass information from a parent process to a new child
process using optional parameters found in the :RUN command and in the
CREATEPROCESS and CREATE intrinsics.  This information can be obtained by
the new process with the GETINFO intrinsic.

Refer to the discussion of passing information to a process in Process 
Management Programmer's Guide (32650-90023).



MPE/iX 5.0 Documentation