Re: TODO-item: Add sleep() function, remove from regress.c

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: TODO-item: Add sleep() function, remove from regress.c
Date: 2006-01-11 00:44:17
Message-ID: 20060111004416.GR3902@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Tue, Jan 10, 2006 at 11:31:13AM +0100, Joachim Wieland wrote:
> No, cancelling the sleep works (at least for Unix). Isn't cancelling
> implemented via a signal that interrupts select() ?
>
> Anyway, I've changed it, removing the ~2000s limit is a good point.
> + while (secs > 1.0)
> + {
> + pg_usleep(1000000);
> + CHECK_FOR_INTERRUPTS();
> + secs -= 1.0;
> + }

Won't this result in a call to pg_sleep with a long sleep time ending up
sleeping noticeably longer than requested?
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2006-01-11 01:02:39 Re: TODO-item: Add sleep() function, remove from regress.c
Previous Message Mark Kirkwood 2006-01-11 00:40:37 Re: Summary table trigger example race condition