Iofthetiger

I think (not 100% sure) that the answer would be to combine epoll and io_uring. It would be a bit more complex system, but I don’t see any incompatibilities between them.

2 Likes

Yes, “use them both, why not” was my first thought, but I was tinkering primarily about single-threaded program and I guess it would not be so easy to combine these two within a single process/thread, so 2-thread app (one being reactor, another being proactor) might be fun idea :slight_smile:

1 Like

Yes, this is the answer. You can have two separate event loops, or two threads. Ideally you would want a single event loop that can pay attention to both types of events, but I don’t know (yet) how to do this myself.

1 Like

Totally wild guessing here, but maybe adding select to the mix for this?

select has scalability issues, it is pretty much replaced by epoll these days.

epoll was introduced in 2.5.44 Linux kernel.
select has an awful interface… when there is no possibility to use epoll i prefer poll, it’s interface is more convinient.

And poll is also available on Windows (starting with 8.1), it is available in std.os.windows.poll.

Windows supports POSIX syscalls since NT 4, if I remember right.

AFAIK, in the past Windows only supported select, because poll was was:

First released in Issue 4, Version 2.
Moved from X/OPEN UNIX extension to BASE

POSIX 2018 Edition
WASPoll

anyhow, they (be it select or poll) are just wrappers around Windows native API:
wnt

Both POSIX and OS/2 subsystems are abandoned by Microsoft. Last OS/2 subsystem was in Windows 2000. POSIX subsystem lived more as SUA (Subsystem for Unix Applications) and Windows Services for UNIX.

Win32API has always included select and has included WSAPoll since Windows Vista/2008.

3 Likes

Sorry for bumping, I’ve just found useful info on how to combine epoll and io_uring, see here and the link given there.

5 Likes

I think you made a copy-paste error, that is two times the same link.

Corrected. Thanks.