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: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 14 Mar 2002 10:18:54 -0000
Message-ID: <1016101242.23627.1.nnrp-12.9e984b29@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 Thu Mar 14 2002 - 04:18:54 CST

Original text of this message

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