threading issue : SIGPIPE => SIG_IGN (writing to closed socket) - Linux

This is a discussion on threading issue : SIGPIPE => SIG_IGN (writing to closed socket) - Linux ; Hello, hopefully you can give me an answer how linux (kernel 2.6.x) reacts (I found different opinoins in the inet): In a multithreaded library a thread sets the sigaction SIG_IGN for signal SIGPIPE if it tries to write to a ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: threading issue : SIGPIPE => SIG_IGN (writing to closed socket)

  1. threading issue : SIGPIPE => SIG_IGN (writing to closed socket)

    Hello,
    hopefully you can give me an answer how linux (kernel 2.6.x) reacts (I found
    different opinoins in the inet):

    In a multithreaded library a thread sets the sigaction SIG_IGN for signal
    SIGPIPE if it tries to write to a socket and resets to the old sigaction
    with SIG_DFL afterwards.

    Will EPIPE allways be returned to the same thread if the socket was closed
    before write (and RST was received)?

    If yes is this guaranteed?

    thanks and kind regards,
    Oliver

  2. Re: threading issue : SIGPIPE => SIG_IGN (writing to closed socket)

    Oliver Kowalke writes:
    > hopefully you can give me an answer how linux (kernel 2.6.x) reacts (I found
    > different opinoins in the inet):


    'Opinions' about facts don't matter.

    > In a multithreaded library a thread sets the sigaction SIG_IGN for signal
    > SIGPIPE if it tries to write to a socket and resets to the old sigaction
    > with SIG_DFL afterwards.
    >
    > Will EPIPE allways be returned to the same thread if the socket was closed
    > before write (and RST was received)?


    Something else would hardly be possible.

  3. Re: threading issue : SIGPIPE => SIG_IGN (writing to closed socket)

    Rainer Weikusat wrote:
    > Oliver Kowalke writes:
    >> In a multithreaded library a thread sets the sigaction SIG_IGN for signal
    >> SIGPIPE if it tries to write to a socket and resets to the old sigaction
    >> with SIG_DFL afterwards.
    >>
    >> Will EPIPE allways be returned to the same thread if the socket was
    >> closed before write (and RST was received)?

    >
    > Something else would hardly be possible.


    OK - does setting SIG_IGN for SIGPIPE also influence the signal action for
    the other threads or is it only 'bound' to the thread whic
    hacall ::sigaction(...)?

    regards,
    Oliver


+ Reply to Thread