Skip site navigation (1) Skip section navigation (2)

Re: OSDL DBT-2 w/ PostgreSQL 7.3.4 and 7.4beta5

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: (view raw, whole thread or download thread mbox)
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 


In response to

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2003-11-04 20:15:10
Subject: Re: Open Sourcing pgManage
Previous:From: Marc G. FournierDate: 2003-11-04 19:58:35
Subject: Re: Open Sourcing pgManage

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group