libev and libevent

Harald Geyer harald at
Tue Feb 20 19:50:42 CET 2018

Andy Green writes:
> Libuv seems to manage it just fine.

libuv used to depend on libev, so that's no surprise. It wouldn't do for
libuv to conflict it's own dependency ...

> it's not going to change no matter what I say.

That's probably true: Even if you had a convincing use case for including
libevent and libev headers in the same source file, Marc can't make it
happen: This would be forcing an API change on all users of libev. Ie make
their progamms stop compiling from one version to the next.

I'm pretty sure, you wouldn't do that to your users either...

But have a look at libelektra:

They are pretty much in the same situation as you. (Users might want to
use asynchroneous IO, but might be using any event loop in their application.)
So far they only work on supporting libuv, yet they do the right thing
from the beginning: Have a separate libuv-binding, that can be installed
or not installed as the user pleases. In future additional bindings for
libev, libevent, glib, etc. can be added if somebody provides them.

And libelektra is a huge project, pulling in a few smallish extra libs
wouldn't change the memory footprint or anything much. Still they don't
do it, because forcing unnecessary dependencies on their users is wrong
for a lot of reasons.

Maybe you can borrow some ideas or even some code from them.


If you want to support my work:
or donate via CLAM to xASPBtezLNqj4cUe8MT5nZjthRSEjrRQXN
or via peercoin to P98LRdhit3gZbHDBe7ta5jtXrMJUms4p7w

More information about the libev mailing list