IBM 000-8697 Manual Do Utilizador

Página de 702
5-24
IBM Informix OnLine Database Server Administrator’s Guide
Psort and Shared Memory
Psort and Shared Memory
Each parallel sort uses one
UNIX
 shared-memory segment.
A front-end process is able to open an unlimited number of
SELECT
cursors
that contain an
ORDER BY
 clause. However, the number of sorts that can be
executed in parallel is limited by the number of shared-memory segments
that each OnLine database server process can attach to. (For more details
about the
UNIX
 parameter that specifies the maximum number of attached
shared-memory segments per process, refer to
.) All cursors beyond
the
UNIX
 limit are executed using nonparallel sorts.
SPINCNT Configuration Parameter
Familiarize yourself with the function of a shared-memory latch before you
begin this section. Refer to
 for background information.
When an OnLine user process attempts to acquire a latch, it tests for avail-
ability. If the latch is not available, the user process can either wait or not wait.
A third option is available on some multiprocessor
UNIX
operating systems:
spin and test again.
In a multiprocessor environment, it is possible for two OnLine user processes
to be resident in a
CPU
and for both user processes to need access to the same
resource. Normally, one user process acquires the resource while the other
process waits. The waiting user process “sleeps,” meaning that the user
process is switched out of the
CPU
.
If a machine supports spin and test, the waiting user process does not sleep.
Instead, it “spins.” The “spinning” that the user process performs while it
waits is an assembly-level activity that varies among machines. The activity
itself does nothing.
The advantage of spinning and testing is that the waiting user process
remains in the
CPU
. This eliminates the overhead of context switching; that
is, the overhead that is incurred when the user process is switched in and out
of the
CPU
. The spin-and-test approach is more efficient than sleeping.