From: | Manfred Spraul <manfred(at)colorfullife(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | markw(at)osdl(dot)org, pgsql-hackers(at)postgresql(dot)org, osdldbt-general(at)lists(dot)sourceforge(dot)net |
Subject: | Re: OSDL DBT-2 w/ PostgreSQL 7.3.4 and 7.4beta5 |
Date: | 2003-11-04 19:58:58 |
Message-ID: | 3FA80502.4000905@colorfullife.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
>Manfred Spraul <manfred(at)colorfullife(dot)com> writes:
>
>
>>For multithreaded apps, this is not possible: sigaction is per process.
>>Thus the calling application must handle the SIGPIPE signals for libpq -
>>either by blocking or ignoring them. We are still discussing the exact
>>API. Probably a global state that is accessible through a new function.
>>
>>
>
>I think we should also take a hard look at avoiding the problem by using
>MSG_NOSIGNAL on platforms that have it,
>
I think that's the second step. First we need a portable solution, then
we can optimize it.
The fastest solution is one signal(SIGPIPE, SIG_IGN) in main(), but that
requires a change in all libpq users. OTHO there shouldn't be that many
multithreaded users.
sigprocmask + sigwait could work, but sigprocmask is undefined if
multiple threads are running. Is there a portable approach for weak
links? libpq would have to call proc_sigmask if linked against
libpthread, and sigprocmask if not linked against libpthread. With gcc,
I could use 'void proc_sigmask () __attribute__ ((weak, alias
("_sigprocmask")));' or something similar, but this wouldn't be portable
either.
--
Manfred
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2003-11-04 20:15:10 | Re: Open Sourcing pgManage |
Previous Message | Marc G. Fournier | 2003-11-04 19:58:35 | Re: Open Sourcing pgManage |