|
|
Subscribe / Log in / New account

Descriptorless files for io_uring

Descriptorless files for io_uring

Posted Jul 29, 2021 6:11 UTC (Thu) by njs (subscriber, #40338)
In reply to: Descriptorless files for io_uring by andresfreund
Parent article: Descriptorless files for io_uring

> Nor do windows completion ports have support for sensible handling of buffers when handling many connections

I haven't tried using Windows's "registered IO", their equivalent to io_uring's ring buffer and registered buffers... is it particularly broken somehow?

> readiness style notification (not building data to send out before socket is ready is useful for efficiency, even if one otherwise uses completion notification), ...

FWIW, IOCP actually does support readiness-style notification -- the windows kernel only understands IOCP, not `select`, so Winsock `select` is actually using IOCP syscalls underneath. The API for this was supposed to be completely internal and undocumented, but someone (@piscisaureus) reverse-engineered it, and it's now used in a number of modern event-loop libraries like libuv, tokio, trio, etc. (And also apparently "Starcraft: Remastered", according to the wine issue tracker.) It's awkward and janky and has some outright bugs you have to work around, but it's so much better than dealing with `select` that it's worth it.


to post comments

Descriptorless files for io_uring

Posted Jul 29, 2021 7:34 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

> I haven't tried using Windows's "registered IO", their equivalent to io_uring's ring buffer and registered buffers... is it particularly broken somehow?

Well, RIO is kinda a completely separate API from regular IOCP and overlapped IO. It is indeed similar to io_uring, albeit more limited.

IOCP is pretty well designed, actually. It's a way better design than the classic POSIX asynchronous APIs, but it's around 20 years old by now and its age is showing.

Descriptorless files for io_uring

Posted Jul 31, 2021 0:56 UTC (Sat) by andresfreund (subscriber, #69562) [Link] (1 responses)

> > Nor do windows completion ports have support for sensible handling of buffers when handling many connections

> I haven't tried using Windows's "registered IO", their equivalent to io_uring's ring buffer and registered buffers... is it particularly broken somehow?

Well, it's not really IOCP network IO, but something that can be bolted sideways to iocp :). But yes, fair enough.

> > readiness style notification (not building data to send out before socket is ready is useful for efficiency, even if one otherwise uses completion notification), ...

> FWIW, IOCP actually does support readiness-style notification -- the windows kernel only understands IOCP, not `select`, so Winsock `select` is actually using IOCP syscalls underneath. The API for this was supposed to be completely internal and undocumented, but someone (@piscisaureus) reverse-engineered it, and it's now used in a number of modern event-loop libraries like libuv, tokio, trio, etc. (And also apparently "Starcraft: Remastered", according to the wine issue tracker.) It's awkward and janky and has some outright bugs you have to work around, but it's so much better than dealing with `select` that it's worth it.

That is *very* interesting. I've occasionally looked in that space because the winsock restrictions are problematic for some things in postgres..

Descriptorless files for io_uring

Posted Aug 5, 2021 1:43 UTC (Thu) by njs (subscriber, #40338) [Link]

> That is *very* interesting. I've occasionally looked in that space because the winsock restrictions are problematic for some things in postgres..

If you want to dig into this trick, I think this issue is the most complete compendium of knowledge currently available: https://github.com/python-trio/trio/issues/52


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds