select() for small sleep

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: select() for small sleep
Date: 2003-12-30 15:37:36
Message-ID: 3FF19BC0.5050904@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

I wrote:

>
> There are a couple of other places where [select()] is used for small
> sleeps (storage/lmgr/s_lock.c and access/transam/xact.c) - those
> should possibly be abstracted out (Windows doesn't behave well there
> anyway, I believe - with 0 FDs I read somewhere it returns immediately
> regardless of the timeout setting).
>

What is the preferred way to handle these 2 cases? We could handle them
with #ifdef'd code inline, or create a new function pg_usleep(), or
possibly handle it with conditional macros inline. If a new function or
macro, where should they go?

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2003-12-30 16:06:07 Re: Is my MySQL Gaining ?
Previous Message Jan Wieck 2003-12-30 15:28:37 Re: [PATCHES] update i386 spinlock for hyperthreading

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2003-12-30 16:51:41 Re: select() for small sleep
Previous Message Claudio Natoli 2003-12-30 15:05:11 Re: hello

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-12-30 16:48:10 Re: [PATCHES] update i386 spinlock for hyperthreading
Previous Message Jan Wieck 2003-12-30 15:28:37 Re: [PATCHES] update i386 spinlock for hyperthreading