|
|
Log in / Subscribe / Register

The rapid growth of io_uring

The rapid growth of io_uring

Posted Jan 30, 2020 12:05 UTC (Thu) by Karellen (subscriber, #67644)
In reply to: The rapid growth of io_uring by josh
Parent article: The rapid growth of io_uring

What if that fd is already in use?


to post comments

The rapid growth of io_uring

Posted Jan 30, 2020 14:39 UTC (Thu) by Baughn (subscriber, #124425) [Link] (3 responses)

The call fails, and you get to fix your code. The IDs should be per-process.

The rapid growth of io_uring

Posted Jan 30, 2020 23:51 UTC (Thu) by Karellen (subscriber, #67644) [Link] (2 responses)

Fix your code? But...

Even per-process, how do you know which fds are free?

Are you suggesting that you should enumerate all the fds currently in use by your program, and then make sure to pick one that you know isn't being used, and hope that another thread doesn't race you to getting it anyway?

Sorry, I think I'm missing an important part of the puzzle somewhere here.

The rapid growth of io_uring

Posted Jan 31, 2020 10:39 UTC (Fri) by klempner (subscriber, #69940) [Link]

You would presumably use an allocator for this, perhaps one that is part of libc.

That allocator wouldn't allocate the same fd twice without a deallocate and could be made threadsafe so you wouldn't have race issues.

The rapid growth of io_uring

Posted Feb 6, 2020 17:26 UTC (Thu) by Wol (subscriber, #4433) [Link]

> Even per-process, how do you know which fds are free?

Run FORTRAN???

That's the way that always worked :-)

Cheers,
Wol

The rapid growth of io_uring

Posted Feb 7, 2020 8:08 UTC (Fri) by renox (guest, #23785) [Link] (1 responses)

Mmm, let's add a "allocate_fd" system call, so now first you allocate/reserve a fd (very fast, you could even preallocate them), then you provide it to the different system calls .. which now have to add additional checks of course.
No way, this will happen but that's an interesting WHAT-IF design change.

The rapid growth of io_uring

Posted Feb 7, 2020 14:41 UTC (Fri) by canoon (guest, #109743) [Link]

All you really need is a range that is reserved for user space allocation. It of course doesn't solve issues around reusing data between requests though.


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