[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Faking EVLOOP_NO_EXIT_ON_EMPTY on earlier versions
On Wed, Aug 17, 2016 at 09:32:13AM -0600, Philip Prindeville wrote:
> I'm working on a program (a Tacacs+ proxy) which, for now, has 2 threads one
> which listens to DBus requests (not using libevent, but I'll change that
> eventually) and another which manages TCP sockets (via the bufferevent
> stuff) inside an event_base_dispatch().
>
> I'm on Debian 8 and have 2.0.5 installed... I don't have
> EVLOOP_NO_EXIT_ON_EMPTY available since that was introduced in 2.1.1.
>
> Is there an easy way to get the same functionality without burning a lot of
> CPU with:
>
> while (1)
> event_base_dispatch(evbase);
Hi Philip,
You can hack this by adding a listener for some signal, with
evsignal_*() stuff.
But maybe it is better to use 2.1?
Cheers,
Azat.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.