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

Re: [Libevent-users] epoll_wait-like timeout with libevent (tick generation)



On 16 October 2012 04:35, Programmist Setevik
<programmist.setevik@xxxxxxxxx> wrote:
> Portability issues aside, is there a way to ask event_base_* functions
> to enforce epoll_wait()-like timeout ?
>
> I need to have an ability to generate "ticks" - say once every 100
> msec or thereabouts and run some callbacks whenever ticks occur.
>
> I understand libevent offers its own way to generate these, but is
> there a way to ask libevent to pass the TO value to epoll_wait ?
>
> The legacy code I have, does something like this (pseudo):

The point of using libevent is it makes your code portable and all the
different IO and timer things all (supposed to) correctly work. :-)

So why would you add an epoll like timeout? You can just use the
libevent timer event and set it to 100ms.


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