System Architecture 2-19
UNIX Kernel and Semaphore-Allocation Parameters
Theshared-memory lower-boundary address
The maximum number of attached shared-memory segments per
process
The maximum amount of shared memory system-wide
The remaining three parameters aresemaphore-allocation parameters:
The maximum number of semaphore identifiers
The maximum number of semaphores
The maximum number of semaphores per identifier
Whentbinit creates the required shared-memory segments, it attempts to
acquire as large a segment as possible. The first segment sizetbinit tries to
acquire is the size of shared memory, rounded up to the nearest multiple of
2KB.
OnLinereceives an error from the operating system if the requested segment
sizeis greater than the maximum allowable size. If OnLine receives an error,
tbinitdivides the requested size by 2 and tries again. For most installations,
more than one segment is required because of aUNIX kernel limitation.
Attempts at acquisition continue until the largest segment size that is a
multiple of 2 KB can be created. Thentbinit creates as many additional
segments as are required to meet shared-memory requirements.
Shared-memory identifiers affect OnLine operation when a user process
attempts to attach to shared memory. For most operating systems, there are
no limits on the number of shared-memory identifiers that a particular user
process can create or attach to. Instead, user processes receive identifiers on
a “first come, first served” basis, up to the limit that is defined for the
operating system as a whole.
Youmight be able to calculate the maximum amount of shared memory that
the operating system can potentially allocate by multiplying the number of
shared-memory identifiers by the maximum shared-memory segment size.
Checkthat the maximum amount of memory that can be allocated is equal to
the total addressable shared-memory size for a single operating-system
process. The following display expresses the concept another way:
Maximum amount of shared memory =
(Maximum number of attached shared-memory segments per process) x
(Maximum shared-memory segment size)