Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!
Дата
Msg-id 4C6D5A7B.4050609@enterprisedb.com
обсуждение исходный текст
Ответ на Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 19/08/10 16:38, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
>> BTW, on what platforms signals don't interrupt sleep? Although that
>> issue has been discussed many times before, I couldn't find any
>> reference to a real platform in the archives.
>
> I've got one in captivity (my old HPUX box).  Happy to test whatever you
> come up with.
>
> Considering that pg_usleep is implemented with select, I'm not following
> what you mean by "replace pg_usleep() with select()"?

Instead of using pg_usleep(), call select() directly, waiting not only 
for the timeout, but also for data to arrive on the "self-pipe". The 
signal handler writes a byte to the self-pipe, waking up the select(). 
That way the select() is interupted by the signal arriving, even if 
signals per se don't interrupt it. And it closes the race condition 
involved with setting a flag in the signal handler and checking that in 
the main loop.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!
Следующее
От: Robert Haas
Дата:
Сообщение: Re: wip: functions median and percentile