You were brought to this page based on an internet search
and as a free service to Oracle DBAs.
The text below is an except from the book,
Oracle Performance Firefighting, written by
Craig Shallahamer of
OraPub, Inc.
Figures and tables are not included on this page, only their reference.
To order the book in either print or PDF form, click
here.
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
-------------------------------
Figure 3-2. A representation of the relationships between code modules, control structures, and memory structures: Module B and module X are contending for control structure CS411, which is currently being held by module Z. Each memory structure has an associated control structure. Before a memory structure can be accessed, the code module must first acquire the associated control structure.
It is important to notice that control structure CS411 has ensured serial access to memory structure MS3. Said another way, without control structure CS411, module B, module X, and module Z could simultaneously be running and accessing memory structure MS3. If any of these three modules makes a change to the memory structure, the results could be memory corruption! As you can see, latches and mutexes play an important role in controlling and ensuring serial memory access.
Let's look at this from more of a kernel code perspective. Figure 3-3 represents a kernel code section. When I worked for Oracle, I rarely saw pure Oracle database server kernel code. One of those rare times was when I was talking with a developer about the redo allocation process. While I don't remember the conversation details, I distinctly recall seeing code similar to Figure 3-3. There was a very simple conditional statement followed by a large chunk of highly indented code. I was shocked at the simplicity and straightforwardness of the latch request (in this situation). I asked the developer if asking for the latch is really this simple. With a puzzled look on his face, he replied, "Well yes, of course it is." Although I was a little embarrassed, it was a good lesson I'll never forget.
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
|