Re: [PATCH v4] [libpq] Try to avoid manually masking SIGPIPEs on every send()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH v4] [libpq] Try to avoid manually masking SIGPIPEs on every send()
Дата
Msg-id 1514.1248458385@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [PATCH v4] [libpq] Try to avoid manually masking SIGPIPEs on every send()  (Jeremy Kerr <jk@ozlabs.org>)
Список pgsql-hackers
Jeremy Kerr <jk@ozlabs.org> writes:
> Currently, libpq will wrap each send() call on the connection with
> two system calls to mask SIGPIPEs. This results in 3 syscalls instead
> of one, and (on Linux) can lead to high contention on the signal
> mask locks in threaded apps.

> We have a couple of other methods to avoid SIGPIPEs:
> sockopt(SO_NOSIGPIPE) and the MSG_NOSIGNAL flag to send().

> This change attempts to use these if they're available at compile-
> and run-time. If not, we drop back to manipulating the signal mask as
> before.

Applied with revisions --- those macro definitions were still a mess
:-(.  In particular, ({...}) is a gcc-ism.
        regards, tom lane


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: When is a record NULL?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: When is a record NULL?