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 spining... in user mode or kernel mode ?

Re: latch spining... in user mode or kernel mode ?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Fri, 16 Nov 2001 16:37:00 +0000
Message-ID: <3BF540AC.2324@yahoo.com>


danisment wrote:
>
> Hi,
>
> I want to know how spinning is implemented on CPU . is it in kernel
> mode, or user mode ?
>
> can we say following pseudo code is correct ?
>
> private int i = 0;
> while (i < _SPIN_COUNT)
> {
> if (test_and_set(latch) == true) return true; // latch is acquired
> here...
> i++;
> }
>
> Danisment Gazi Unal
> http://www.unal-bilisim.com

No, the spin is used to "pause" without relinquishing the cpu - we spin, and *then* try to get the latch.

hth
connor

-- 
==============================
Connor McDonald

http://www.oracledba.co.uk

"Some days you're the pigeon, some days you're the statue..."
Received on Fri Nov 16 2001 - 10:37:00 CST

Original text of this message

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