why are ringbuffers bound to an existing file descriptor?
why are ringbuffers bound to an existing file descriptor?
Posted Jun 13, 2024 13:42 UTC (Thu) by koverstreet (✭ supporter ✭, #4296)In reply to: why are ringbuffers bound to an existing file descriptor? by donald.buczek
Parent article: A generic ring buffer for the kernel
So once we switch to futex operations for wait/wake, you'll be able to make your own ringbuffer in shared memory, no kernel involvement.
Posted Jun 14, 2024 17:12 UTC (Fri)
by donald.buczek (subscriber, #112892)
[Link] (1 responses)
I was just curious whether an unconventional use of the proposed ringbuffer API for userspace to userspace communication would work, assuming that whatever the kernel does with the ringbuffer for the chosen file type doesn't interfere or is taken into account. It's not sensible or needed, though, because that can be done right now and you only need help from the kernel for the non-spinning wait, e.g., via futex, which is available.
Regarding my first question, why a ringbuffer needs to be associated with a file descriptor: Do you expect ringbuffers will only be used as an alternative api to the same data channels as accessible by reading/writing the file descriptors? Is this why there is no standalone ringbuffer? Any kernel feature which supports ringbuffer communication should also support conventional I/O on the same descriptor?
Posted Jun 14, 2024 18:52 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link]
why are ringbuffers bound to an existing file descriptor?
why are ringbuffers bound to an existing file descriptor?