Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: latch spining... in user mode or kernel mode ?
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