Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How does spin count really works

How does spin count really works

From: Bass Chorng <bchorng_at_yahoo.com>
Date: 7 Nov 2004 11:55:52 -0800
Message-ID: <bd9a9a76.0411071155.1dde1f90@posting.google.com>


I have a question on how spin counting really works.

Lets assume the default of 2000 on _spin_count. So a latch miss session starts kernel code loop for 2000 times and try it again.

My question is does it check again only after completing the 2000 loops or it will stop in the middle if the latch is available before completing the loop ?

If it is the latter, how does it know that latch is available halfway ? I assume there must be some kind of post and interrupt process which I suspect would be very expensive. I know latch posting exists in some but not all OS, and I am not sure if it is for this purpose. As to interrupt, it is something I am not aware of.

If it is the former, then my question extends to why would a larger value in _spin_count increase the chance getting the latch ? It then becomes a matter of pure luck in timing. Looping 5,000 times, instead of 2,000 times, really should not increase the chance. All it does is burning more CPU cycles.

Appreciate it if you know the answer and can share the internals. Received on Sun Nov 07 2004 - 13:55:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US