Re: epoll implementation for Cygwin

Hamish McIntyre-Bhatty via Cygwin <[email protected]> Tue, 31 Mar 2026 14:56:38 +0100
Newsgroups gmane.os.cygwin
Message-ID <[email protected]>
On 23/03/2026 08:02, Jakob Bohm via Cygwin wrote:
> On 21/03/2026 01:51, Daisuke Fujimura via Cygwin wrote:
>> Hi Hamish and all,
>>
>> As the author of cygepoll, I’d like to provide some context regarding
>> its implementation.
>>
>> Currently, cygepoll is an experimental wrapper around upoll
>> (https://github.com/richardhundt/upoll). In the Cygwin environment, it
>> simply maps the epoll interface onto poll or select.
>>
>> Because it relies on these underlying mechanisms, it doesn't offer the
>> performance benefits typically associated with epoll on Linux. It
>> essentially carries the same overhead as poll or select.

Ah, I see. Thanks for letting me know this. As sys/epoll.h isn't a hard 
requirement for wxWidgets, I guess using this may be of little to no 
benefit then.

>>
>> If the goal is to provide a truly performant epoll implementation for
>> Cygwin, I believe it should be implemented natively within
>> cygwin1.dll—perhaps by leveraging Windows-specific APIs.
> Indeed, Windows sockets (WinSock2) has a more powerful implementation of
> select() than traditional POSIX systems like Linux.  In particular,
> WinSock native select uses true sets for the handle lists and isn't
> limited to the low valued handles like on Linux, though cygwin may be
> emulating the Linux-style FD_SET implementation.  There is also the
> WSAEventSelect() native function which maps the wait for a single
> (socket,condition) to a wait for a single Win32 Event (an NT kernel
> KEVENT, which is a tiny object), and the core Win32 API has the
> WaitForMultipleObject() family of functions which can wait for up to 64
> such Win32 events or a timeout in parallel, allowing easy handling of
> 63 events per thread in a thread pool (Using the 64th slot for
> signalling changes to the list of events).
> 
>> Providing cygepoll as a standalone package might offer API
>> compatibility, but it wouldn't meet the performance expectations users
>> have for epoll. Therefore, I think discussing a native implementation
>> within the Cygwin core is a more meaningful path than packaging my
>> current experimental library.

That makes a lot of sense. Thanks again both.

>>
>> Best regards,
>>
>> Daisuke Fujimura
>>
>> On Sat, Mar 21, 2026 at 6:03 AM Hamish McIntyre-Bhatty via Cygwin
>> <[email protected]> wrote:
>>> Hi all,
>>>
>>> I recently stumbled across this epoll implementation for Cygwin:
>>> https://github.com/fd00/cygepoll
>>>
>>> I'm not sure how to test it, or even if it would still work, as it is
>>> very old, but I know that wxWidgets at least could benefit from
>>> something like this. Is there any chance we could integrate it into
>>> Cygwin as a package?
> 
> Enjoy
> 
> Jakob

Best,
Hamish


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple