Signals

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed May 27 12:28:50 PDT 2015


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150527/6f6c829b/attachment.sig>


More information about the Digitalmars-d mailing list