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 -> Re: Latch spin - OS timeslice

Re: Latch spin - OS timeslice

From: Alex Bardos <alexbrds_at_yahoo.com>
Date: 25 Mar 2002 18:07:01 -0800
Message-ID: <f5e30250.0203251807.92e1747@posting.google.com>


My understanding, based primarily on "Oracle Internal Services for Waits, ..." by Steve Adams, is as follows:

Oracle goes:


S	|
	|gimme
	|tiny_active_wait
P	|gimme
	|tiny active wait
	|gimme
I	|tiny_active_wait
	|...
	|...
N	|gimme
	______

where the amount of time spent in "tiny_active_wait" used to be configurable (Oracle 7) through _LATCH_SPIN_COUNT; the number of "gimme + tiny_active_wait" (# of attempts to acquire a latch) in the outer SPIN cycle configurable through _SPIN_COUNT (default 2000 ?). I would expect the "tiny_active_wait" to be negligible relative to the time slice. I would expect the whole SPIN cycle to be comparable to the time slice, still smaller though to increase chances of not being preempted by the OS after the time slice is up. Any idea how much time one iteration of "gimme + tiny_active_wait" takes ?

Thanks.  

"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message news:<1016101242.23627.1.nnrp-12.9e984b29_at_news.demon.co.uk>...
> I think you'll find it varies across platforms.
>
> The 'latch spin' is just a loop of code where
> Oracle goes:
> gimme
> gimme
> gimme
> gimme
> gimme
> gimme
>
> until it reaches a limit count, or until it gets
> the latch.
>
> No doubt there is supporting code in the
> loop somewhere for counting and timing
> purposes, but pre-9, I believe the most
> commonly used instruction was the
> atomic 'test and set' instruction.
>
>
> Your comment about length of spin relative
> to time slice is interesting, because it is
> virtually the only good reason for considering
> adjusting the spin_count (or latch_spin_count)
> parameter.
>
> The spin_count has not changed (I believe) since
> it was first introduced, not has the typical latch sleep
> time, (nor, in passing has the approximate cost of a
> context switch). but CPU speeds have gone up by
> a factor of 5 or so. Consequently, we now
> spin for much less time
>
> sleep for a time which loses far more work-time than
> it used to.
>
> pay the cost of a task-switch a lot sooner
> than we used to.
>
>
>
> --
> Jonathan Lewis
> http://www.jlcomp.demon.co.uk
>
> Next Seminar - UK, April 3rd - 5th
> http://www.jlcomp.demon.co.uk/seminar.html
>
> Host to The Co-Operative Oracle Users' FAQ
> http://www.jlcomp.demon.co.uk/faq/ind_faq.html
>
> Author of:
> Practical Oracle 8i: Building Efficient Databases
>
>
> Alex Bardos wrote in message ...
> >Hi,
> >
> >I am looking for information on what instructions are being executed
> >when Oracle is in latch spin (active wait) and how long the spin is
> >relative to OS time slice (e.g. 10 ms).
> >
> >Thanks.
Received on Mon Mar 25 2002 - 20:07:01 CST

Original text of this message

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