previous next top complete contents complete index framed top this page unframed
To share the MAINSAIL kernel or a MAINSAIL object MODULE library,
you must run the MAINSAIL MODULE SHMCTL
to tell the operating system
about the files you wish to share.
You must repeat this procedure every time the operating system is
rebooted.
In addition, you must build MAINSAIL bootstraps with a special
bit set in UNIXBITS, or they will not
be able to take advantage of the
information provided to the OS by SHMCTL.
7.1. Systems Where Mapping Is Automatic
The majority of UNIX systems provide the mmap system call.
On those systems, memory mapping is automatic;
you do not need to do anything in particular to take advantage of
memory mapping on these systems.
7.2. Systems Where Mapping Is Not Automatic: HPPA, HPPA64,
and RAIX before OS Version 3.2
On some platforms (currently HPPA, HPPA64,
and the versions of the RAIX
operating system before 3.2), it is not possible
to map files automatically, but you can still perform a procedure
manually that will subsequently permit MAINSAIL to share specified
files.
7.3. Running SHMCTL
To share an object library (or the MAINSAIL kernel),
run the MAINSAIL MODULE
SHMCTL and specify the command add fileName
for each file to be
shared. You must specify the full path name of the file as the file
name will be passed to openLibrary
or as the file name is specified in
the MAINSAIL bootstrap.
Then run CONF and create a bootstrap with the 'H100 bit set in the UNIXBITS parameter. The resulting bootstrap will share the files that were specified to SHMCTL.
On RAIX, the MAINSAIL kernel MODULE can be shared as well as MAINSAIL object libraries. On HPPA and HPPA64, only libraries can be shared; the kernel MODULE cannot.
If you delete or modify a shared file, you should also delete the corresponding shared segment. The person who runs SHMCTL to delete a segment has to be the same user as the one who added it. However, anyone can use the segment regardless of who created it.
To confirm that you have successfully created and are using a shared section, you may want to run MM and issue the m command before running SHMCTL, and then run MM again under the new bootstrap after running SHMCTL. The MM m command prints out (among other things) the number of mapped library pages used by the current process. The number should be 0 before running SHMCTL and nonzero afterwards.
Example 7–1 shows all the steps needed to create a shared section, build a bootstrap that uses it, and confirm that the shared section is being used. The example is for HPPA, where only the system library (as displayed by the SYSTEMLIBNAME parameter after CONF's show command) can be shared. On RAIX, where you can share the MAINSAIL kernel MODULE as well, you should specify an additional add command to SHMCTL, taking the argument from the CONF KERMODNAME parameter. Be aware also that the commands used to compile and link a bootstrap vary from platform to platform; check Section B.3 for details.
Example 7–1. Example Use of SHMCTL on HPPA
% mainsa<eol> To build the bootstrap and create the shared section:
CONF: show<eol> |
Shared segments last only until your computer is rebooted. Because it is inconvenient to remember to run SHMCTL every time you reboot your system, you may want to run it automatically at system startup time (e.g., by putting the commands to run it in rc.local).
On some systems, you may be unable to create a shared segment for the
MAINSAIL system library,
because some systems limit the maximum shared segment size to a
relatively small value.
In general, it is not advisable to set this bit.
However, if you should encounter problems with mapped libraries, you
may wish to do so.
7.4. Disabling Automatic Mapping
On systems other than
HPPA, HPPA64, and RAIX before OS Version 3.2,
you can create a bootstrap that disables automatic memory mapping
of libraries and the kernel MODULE
by setting the UNIXBITS parameter
to include the bit 'H4000.
7.5. Caveats
Be careful not to run SHMCTL on the RAIX
OS Version 3.2 or later
unless automatic mapping has been disabled, as described in
Section 7.4.
The RAIX documentation warns:
Thus, SHMCTL is incompatible with the mapping that takes place automatically under later versions of the OS.
MAINSAIL System-Specific User's Guides, Chapter 7