Re: Interrupting long external library calls

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interrupting long external library calls
Дата
Msg-id 23525.1337963694@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Interrupting long external library calls  (Sandro Santilli <strk@keybit.net>)
Ответы Re: Interrupting long external library calls  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Interrupting long external library calls  (Sandro Santilli <strk@keybit.net>)
Список pgsql-hackers
Sandro Santilli <strk@keybit.net> writes:
> I ended up providing an explicit mechanism to request interruption of
> whatever the library is doing, and experimented (successfully so far)
> requesting the interruption from a SIGINT handler.

> Do you see any major drawback in doing so ?

This seems a bit fragile.  It might work all right in Postgres, where
we tend to set up signal handlers just once at process start, but ISTM
other systems might assume they can change their signal handlers at
any time.  The handler itself looks less than portable anyway ---
what about the SIGINFO case?

I assume that the geos::util::Interrupt::request() call sets a flag
somewhere that's going to be periodically checked in long-running
loops.  Would it be possible for the periodic checks to include a
provision for a callback into Postgres-specific glue code, wherein
you could test the same flags CHECK_FOR_INTERRUPTS does?  A similar
approach might then be usable in other contexts, and it seems safer
to me than messing with a host environment's signal handling.
        regards, tom lane


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: 9.2beta1, parallel queries, ReleasePredicateLocks, CheckForSerializableConflictIn in the oprofile
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 9.2beta1, parallel queries, ReleasePredicateLocks, CheckForSerializableConflictIn in the oprofile