IBM 000-8697 Manual de usuario Pagina 156

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 702
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 155
2-62 IBM Informix OnLine Database Server Administrator’s Guide
How a User Process Acquires a Buffer
Step 4: Read the Page in from Disk
If the requested page must be read from disk, the user process first locates a
usable buffer in the FLRU queues. (Refer to page 2-57.) OnLine selects an
FLRU queue at random and tries to acquire the latch associated with the
queue.Ifthelatchcanbeacquired,thebufferatthe“least-recentlyused”end
of the queue is used. If another process holds the FLRU queue latch, the user
process tries to acquire a latch associated with another FLRU queue.
After a usable buffer is found, the buffer is temporarily removed from the
linked list that is the
FLRU queue. The user process acquires a latch on the
buffertablehashstructureandcreatesanentryinthe buffertableasthepage
is read from disk into the buffer.
Steps 5-7: Lock Buffer, Release Lock, and Wake Waiting Processes
Iftheuserprocessreadsthebufferwithout modifyingthedata,itreleasesthe
buffer as unmodified. If the user process had acquired the buffer with an
update or exclusive lock, other user processes may be waiting to read the
buffer.
The release of the buffer occurs in steps. First, the releasing user process
acquires a latch on the buffer table that enables it to modify the buffer entry.
Next, it looks to see if other user processes are sleeping or waiting for this
buffer. If so, the releasing user processwakes the first processin the wait-list
queue that has a compatible lock-access type. The waiting processes are
queued according to priorities that encompass more than just “first-come,
first served” hierarchies. (Otherwise, user processes waiting for exclusive
access could wait forever.)
If no user process in the wait-list queue has a compatible lock-access type,
any user process waiting for that buffer can receive access.
Ifnoprocessiswaitingforthebuffer, thereleasingprocesstriesto releasethe
buffertotheFLRU queuewhereitwasfound. If the latch forthatFLRUqueue
is unavailable, the process tries to acquire a latch for a randomly selected
FLRU queue. When the FLRU queuelatch isacquired,the unmodifiedbuffer
is linked to the “most-recently used” end of the queue.
After thebuffer is returnedto theFLRU queue or the next user process in the
wait list is awakened, the releasing process removes itself from the user list
bit map for the buffer and decrements the shared-user count by one.
Vista de pagina 155
1 2 ... 151 152 153 154 155 156 157 158 159 160 161 ... 701 702

Comentarios a estos manuales

Sin comentarios