How to implement epoll (Linux) o kqueue (BSD/macOS) in the Cygwin DLL

Marco Atzeri marco.atzeri@gmail.com
Thu Sep 17 10:03:45 GMT 2026


Original issue and some discussion on the python-trio

https://github.com/python-trio/trio/issues/3513

Key point from their side
---------------------------------------------------------------------
Unfortunately the "vanilla Unix behavior" for multiplexed I/O readiness 
(select or poll), which Cygwin does appear to support, is decades old. 
It does not scale well to large numbers of connections and is difficult 
to use from multiple threads (which is relevant for Trio's "guest mode" 
feature). Trio supports more modern alternatives such as epoll (Linux), 
kqueue (BSD/macOS), and IOCP (native Windows), which don't have these 
issues. Unfortunately, Cygwin doesn't support any of these.

If you want Cygwin support on Trio, you will need to create a new 
IOManager type for it. It can use select or poll. These will have worse 
performance than the other IOManager types that Trio supports, and they 
also will not work with guest mode due to thread-safety issues.
---------------------------------------------------------------------

Last suggestion was

----------------------------------------------------------------------
You'll probably want to point them to https://github.com/piscisaureus/wepoll
which has the magic incantations you need to implement epoll on Windows
(this is the original project that libuv/tokio/trio/probably others by the
point all referenced to figure out how to make windows sockets good)
----------------------------------------------------------------------


This stuff is outside my usual Cygwin comfort zone;
could anyone look at it and propose a path ?

Thanks
Marco


More information about the Cygwin-developers mailing list