Re: Some interesting results from tweaking spinlocks
| От | Tom Lane |
|---|---|
| Тема | Re: Some interesting results from tweaking spinlocks |
| Дата | |
| Msg-id | 13361.1010268276@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Some interesting results from tweaking spinlocks (Brent Verner <brent@rcfile.org>) |
| Ответы |
Re: Some interesting results from tweaking spinlocks
|
| Список | pgsql-hackers |
Brent Verner <brent@rcfile.org> writes:
> Using a single-processor machine, we're not going to get any lower
> sleep times than ~10ms from either usleep or select on linux, and
> usleep is always longer.
Ah, so usleep is just being stricter about rounding up the requested
delay? That would explain the results all right.
> Looks like increasing spins allows
> the process to get the lock before the usleep/select is run
Right. Up to a point, increasing spins improves the odds of acquiring
the lock without having to release the processor.
What I should've thought of is to try sched_yield() as well, which is
the operation we *really* want here, and it is available on this version
of Linux. Off to run another batch of tests ...
regards, tom lane
В списке pgsql-hackers по дате отправления: