
System Architecture 2-19
UNIX Kernel and Semaphore-Allocation Parameters
■ The shared-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 are semaphore-allocation parameters:
■ The maximum number of semaphore identifiers
■ The maximum number of semaphores
■ The maximum number of semaphores per identifier
When tbinit creates the required shared-memory segments, it attempts to
acquire as large a segment as possible. The first segment size tbinit tries to
acquire is the size of shared memory, rounded up to the nearest multiple of
2 KB.
OnLinereceivesanerrorfromtheoperatingsystem if therequestedsegment
size isgreaterthan themaximum allowable size. If OnLine receives anerror,
tbinit divides the requested size by 2 and tries again. For most installations,
more than one segment is required because of a UNIX kernel limitation.
Attempts at acquisition continue until the largest segment size that is a
multiple of 2 KB can be created. Then tbinit 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.
You mightbe 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.
Checkthatthemaximumamountofmemorythatcanbeallocatedisequalto
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)
Comentarios a estos manuales