|
Boost : |
From: Oliver.Kowalke_at_[hidden]
Date: 2005-12-13 02:21:54
Hi Chris,
>Hi Oliver,
>Is sigaction safe with threads? Doesn't it set the process-wide signal
>handler? If so, that won't work if a process might be doing writes from
>multiple threads.
In the documentation from OpenGroup for sigaction:
'At the time of generation, a determination is made whether the signal
has been generated for the process or for a specific thread within the
process.
... However, a signal can be blocked from delivery to a thread If the
action associated with a blocked signal is anything other than to ignore
the signal, and if that signal is generated for the thread the signal
will remain pending until it is unblocked, it is accepted when it is
selected and returned by a call to the sigwait() function, or the action
associated with it is set to ignore the signal.'
>I've been doing a bit of reading along the lines of what Jeremy
>suggested, and it seems like best thing at this stage is:
>- On linux use sendmsg with the MSG_NOSIGNAL flag.
>- On Mac OS X use setsockopt with SO_NOSIGPIPE option.
I think this would bet he prefered way.
Oliver
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk