On Wed, 27 May 2015 16:08:28 +0000, Robbin wrote: > I'm using nanomsg to communicate between various components (actually > distributed across a number of computers) and my main event loops are > waiting for a message. The reads are encapsulated in a class, so I > guess I'll change from a recv to a poll and add a second channel to > communicate when it is time to die. In the signal handler I can send a > message and in the class, send a std.signal to end the thread and then > clean up the main loop and exit. nn_poll is a c routine, so I should > work comfortably in the handler. > > I wish there was a more direct way to do this. Signals are a bread and > butter aspect of the Linux architecture. I guess mangling is at the > root of the problem. > > Thank you.
if you are on GNU/Linux, you can use `signalfd` to integrate signal processing in your event loop.
signature.asc
Description: PGP signature
