Re: Spin Lock sleep resolution - Mailing list pgsql-hackers

From Claudio Freire
Subject Re: Spin Lock sleep resolution
Date
Msg-id CAGTBQpY3gspgQ3jQB-q9Ck9UicNJpC_4GN6mGEtNKX2di1WWEg@mail.gmail.com
Whole thread Raw
In response to Re: Spin Lock sleep resolution  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Apr 2, 2013 at 1:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Jeff Janes <jeff.janes@gmail.com> writes:
>> The problem is that the state is maintained only to an integer number of
>> milliseconds starting at 1, so it can take a number of attempts for the
>> random increment to jump from 1 to 2, and then from 2 to 3.
>
> Hm ... fair point, if you assume that the underlying OS has a sleep
> resolution finer than 1ms.  Otherwise it would not matter.


I would guess it does matter for the cumulative error when re-sleeping
several times.

In any case, the resolution is limited on tick-based kernels, which
are few nowadays. However, I've found evidence[0] that FreeBSD is
still on that boat.

[0] http://lists.freebsd.org/pipermail/freebsd-arch/2012-March/012423.html



pgsql-hackers by date:

Previous
From: Atri Sharma
Date:
Subject: Re: Page replacement algorithm in buffer cache
Next
From: Merlin Moncure
Date:
Subject: Re: Page replacement algorithm in buffer cache