| From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
|---|---|
| To: | Scott Lamb <slamb(at)slamb(dot)org> |
| Cc: | Manfred Spraul <manfred(at)colorfullife(dot)com>, Steve Atkins <steve(at)blighty(dot)com>, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Mixing threaded and non-threaded |
| Date: | 2004-01-30 22:53:55 |
| Message-ID: | 200401302253.i0UMrug24137@candle.pha.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Scott Lamb wrote:
> Scott Lamb wrote:
> > You could just do a pthread_sigmask() before and after the
> > pthread_setspecific() to guarantee that no SIGPIPE will arrive on that
> > thread in that time. I think it's pretty safe to assume that as long as
> > you're not doing a pthread_[gs]etspecific() on that same pthread_key_t,
> > it's safe.
>
> Actually, thinking about this a bit more, that might not even be
> necessary. Is SIGPIPE-via-(read|write) synchronous or asynchronous?
> (I.e., is the SIGPIPE guaranteed to arrive during the offending system
> call?) I was thinking not, but maybe yes. I can't seem to find a
> straight answer. A lot of documents seem to confuse thread-directed and
> synchronous, when they're not quite the same thing. SIGALRM-via-alarm()
> is thread-directed but obviously asynchronous.
SIGPIPE is a sychronous signal that is called during the read() in
libpq. I am not sure what thread-directed is.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-01-30 23:02:58 | Re: Question about indexes |
| Previous Message | Bruce Momjian | 2004-01-30 22:52:31 | Re: Mixing threaded and non-threaded |