[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Multi-threaded support in libevent



On 02/23/17 11:20, Tôn Loan wrote:
[---]
> So, is there any solution for each event_base that will receive its own
> signals?

   I needed something similar myself a few years ago, and I think I
concluded that libevent couldn't handle per-thread granularity for signals.

   Source of relevant module:
https://github.com/libevent/libevent/blob/master/signal.c

   (The warning message in evsig_add() seems relevant).

   In my case I wanted to use signals as, well, a signalling mechanism
(tell threads to update their configuration, terminate the event loop,
etc).  It was a long time ago, and I can't remember exactly how I solved
it, but I recall experimenting with pipes.  If what you need is IPC to
control the event loops in the tread, check out pipes.

-- 
Kind regards,
Jan Danielsson

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.