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

[Libevent-users] Best way for additional events registration in the same thread



Hello,

atÂhttp://www.wangafu.net/~nickm/libevent-book/Ref3_eventloop.html, there is a note that

"Ordinarily, the loop will exit as soon as it has no pending or active events. You can override this behavior by passing the EVLOOP_NO_EXIT_ON_EMPTY flag---for example, if youâre going to be adding events from some other thread."

This seems to imply that it is only recommended to add events if another thread is used?

This program:Âhttps://raw.githubusercontent.com/bagder/curl/master/docs/examples/hiperfifo.cÂmanages to register additional events after dispatch is called, but seems to rely on the existence of a persisting event.

Is that the only way? What is the best way?

Thanks in advance