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-123 fora definition of rowid.) OnLine translates the logical rowid into
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, or exclusive. (Refer to page 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.Todo this, it tries to acquire a latch on the hash table associated with
thebuffer table. If the process can acquire the latch, it searches the hash table
tosee if an entry matches the requested page. If it finds an entry for the page,
it releases the latch on the hash table and tries to acquire the latch on the
buffer header entry in the buffer table.
Withaccess to the buffer header, the requesting process adds its user process
IDto the user list bit map for the buffer and increments the shared-user count
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.If the current lock-access level is incompatible, the requesting process
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.