Re: SIGPIPE handling, take two.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SIGPIPE handling, take two.
Дата
Msg-id 10059.1068571692@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SIGPIPE handling, take two.  (Manfred Spraul <manfred@colorfullife.com>)
Ответы Re: SIGPIPE handling, take two.  (Manfred Spraul <manfred@colorfullife.com>)
Список pgsql-patches
Manfred Spraul <manfred@colorfullife.com> writes:
> What about multithreaded apps?

>   old = pgsignal(SIPEPIPE, SIG_IGN);
>   ** another thread calls sigaction(SIGPIPE,,);
>   pgsignal(SIGPIPE, old);

> And the signal state is corrupted.

If other threads are changing the signal state mid-flight, we are
screwed anyway; if not here then later when we are doing sends,
or even more directly because our test here may not reflect reality
later.

I don't think we need to complicate pqsignal's API for this.  Instead
we'd better document that SIGPIPE handling has to be set up and kept
stable before doing any libpq operations in a multithread app.

            regards, tom lane

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

Предыдущее
От: Manfred Spraul
Дата:
Сообщение: Re: SIGPIPE handling, take two.
Следующее
От: Manfred Spraul
Дата:
Сообщение: Re: SIGPIPE handling, take two.