
System Architecture 2-61
How a User Process Acquires a Buffer
Step 1: Identify the Data
OnLine user processes request a specific data row by rowid. (Refer to
page 2-123foradefinitionofrowid.)OnLinetranslatesthelogicalrowidinto
a physical page location. The user process searches for this page.
Step 2: Determine Lock-Access Level
Next OnLine determines the level of lock access required by the requesting
userprocess:share,update,orexclusive.(Refertopage 2-38 for further infor-
mation about buffer locks.)
Step 3: Locate the Page in Memory
The user process first attempts to locate the requested page in shared
memory.Todothis,ittriestoacquirealatchonthehashtableassociatedwith
the buffer table. Ifthe processcan acquire the latch,it searches the hash table
tosee if anentrymatches the requestedpage. If itfindsan entry forthepage,
it releases the latch on the hash table and tries to acquire the latch on the
buffer header entry in the buffer table.
With accessto thebufferheader, the requesting processadds itsuser process
IDtotheuser listbitmapforthebufferandincrementstheshared-usercount
by 1.
The user process tests the current lock-access level of the buffer.
If the levels are compatible, the requesting user process gains access to the
buffer. Ifthe current lock-access levelis incompatible, therequestingprocess
puts itself on the user wait list of the buffer. The buffer state, unmodified or
modified, is irrelevant; even unmodified buffers can be locked.
For further information about the entry stored in the buffer table, refer to
page 2-48.
Comentarios a estos manuales