bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deadlock in signal handler


From: Kyle Rose
Subject: Re: Deadlock in signal handler
Date: Thu, 16 Mar 2017 12:10:33 -0400

On Thu, Mar 16, 2017 at 11:59 AM, Daniel Herring <address@hidden> wrote:
Hi Paul,

Have you considered using the pattern of using a socket for signal handling?  Then the signal handler writes a byte or closes the socket. The other end of the socket detects this using select() or equivalent. Can be a unix pipe or network socket, depending on where the endpoints live.  Can support threads, processes, and distributed processes, all in a portable manner.Iwould avoid the need for calling gettext routines from the handler.

I second this approach. Event system frameworks that deal with sockets, subprocesses, and signals generally all work this way internally to avoid some of the nastier signal edge cases.

Kyle

reply via email to

[Prev in Thread] Current Thread [Next in Thread]