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 ?
Hello Connor,
Thank you for your response.
If you mean pause() system call by 'pause', I'll be disagree. I think, Oracle can not use pause() system call to spinning latch. Because, when pause() system call is used, process does't use CPU, while waiting for the latch; thus busy waiting is avoided. In our case, CPU is not relinquished, busy wait is done.
according to my test, Oracle uses select() system call to sleep on wait queue.
Connor McDonald <connor_mcdonald_at_yahoo.com> wrote in message news:<3BF540AC.2324_at_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
Received on Sat Nov 17 2001 - 04:41:22 CST