Better Windows backend using wepoll?

Linus Yang laokongzi at gmail.com
Thu May 31 13:55:13 CEST 2018


Dear libev authors and the community,

Libev has relatively weaker support on Windows than other Unix-like
platforms (Linux, BSD and macOS) due to the complexity of IOCP event
model.

Recently, Bert Belder (@piscisaureus on Github) released an epoll-like
library for Windows, called wepoll [1], that wraps IOCP APIs. One can
seamlessly use epoll APIs on Windows with high performance. The recent
version has fixed some LSP (Layered Service Provider) compatibility
issues and should be quite stable for normal use.

Note that with the existence of LSP dlls (e.g., Anti-virus software,
Proxifier, etc.), libuv on Windows silently falls back to a "slow
mode" that uses select() as backend. Such issue does not come with the
latest version of wepoll. Also, wepoll is significantly more
lightweight and very friendly to embed inside a project, just by
copying two source files (.c and .h).

I tried to port shadowsocks-libev [2] to MinGW using wepoll. The libev
library only needs very few changes [3] to use wepoll as backend. We
currently maintain a local fork of libev and prefer if such change
could go upstream.

Do you have any interest or opinions on integrating the wepoll library
inside libev for better Windows support?

Thanks!

[1] https://github.com/piscisaureus/wepoll
[2] https://github.com/shadowsocks/shadowsocks-libev
[3] https://github.com/shadowsocks/libev/commits/mingw



More information about the libev mailing list