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.
-------------------------------
If you are comfortable with the latching pseudocode shown in Figures 3-6 and 3-7, you will quickly grasp Oracle's mutex algorithm shown in Figures 3-15 and 3-16. As you can see, there are some interesting twists!
Looking at Figures 3-15 and 3-16, you can quickly see some similarities between the latching and mutex algorithms. The concepts of willing to wait versus immediate (nowait), spinning, sleeping, and posting the wait event when sleeping are very similar. However, there are a few distinct differences.
It all starts with the mutex request. Just as with latches, the specific mutex is requested along with the type of either nowait (that is, immediate) or willing to wait, and the mode of either shared or exclusive. If a nowait request is made, similar to latching, a single fast get request occurs. If a willing-to-wait request occurs, a single fast get is requested; if it fails, processing drops into the familiar spin-and-sleep cycle. While both latches and mutexes have the same spin and sleep objectives, as you'll see, how this plays out in practice is very different.
©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.
|