2-24 IBM Informix OnLine Database Server Administrator’s Guide
How User Processes Attach to Shared Memory
How User Processes Attach to Shared Memory
OnLinerequires a technique to ensure that all OnLine user processes find and
gain access to the same shared-memory segments. If two or more OnLine
database servers exist on a singleUNIX host machine, the shared-memory
segments associated with each OnLine server exist at different locations in
physical memory. The shared-memory segments for each OnLine server
must be uniquely identifiable to the database user processes.
The following list outlines the major steps that are completed when an
OnLine user process attaches to shared memory:
1. User process obtains SERVERNUM from configuration file.
2. User process calculates a shared-memory key value using
SERVERNUM.
3. User process requests a shared-memory segment using the shared-
memory key value. UNIX returns the shared-memory identifier for
the first shared-memory segment.
4. Userprocess directs UNIX to attach the shared-memory segment to
its process space atSHMBASE.
5. If required, additional shared-memory segments are attached to be
contiguous with the first segment.
The tbinit daemon process creates the OnLineshared-memory segments
during initialization. (Refer to page2-10.) Associated with each shared-
memory segment are two pieces of information:
A shared-memory key value
A shared-memory identifier

Step 1: Obtain SERVERNUM

Whena user process directs the UNIX operating system to a shared-memory
segment,it defines the segment it needs using the shared-memory key value.
Toattach to the segment, the user process must acquire fromUNIX the shared
memory identifier that is associated with that segment. TheUNIX operating
system uses these identifiers to track each shared-memory segment.