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.
-------------------------------
Once in the spin-sleep loop, a call to the Spin_Get function is made. Figure 3-7 shows the Spin_Get function pseudocode. The Oracle process will perform repeated fast gets until either the latch is acquired or the numbers of spins reaches the hidden _spin_count instance parameter value. This is where the term spinning on a latch originates.
For years, the _spin_count instance parameter has been set to 2000 by default, which is still the case in Oracle Database 11g. Note that Oracle does not spin for 2,000 ms, but rather makes up to 2,000 latch fast get requests.
A good mental picture of spinning on a latch is to think of a room full of people looking intently at the room's center. There is a hole in the very center of the room where the just-released latch shoots out like a rocket. All the people in the room are repeatedly yelling, "Give me the latch!" and swinging their arms as fast as they can up to 2,000 times, hoping that their hand will move over the launch spot just as the latch is released. When they look in their hand, the contestants hope to see the latch. If they don't, they continue swinging their arms and yelling (up to _spin_count times), hoping next time they will be the lucky one.
©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.
|