axboe / liburing

Library providing helpers for the Linux kernel io_uring support
MIT License
2.88k stars 404 forks source link

multiprocess and kernel space question #1278

Closed NathanFreeman closed 1 week ago

NathanFreeman commented 1 week ago

Hello, I want to use IORING_OP_FUTEX_WAKE and IORING_OP_FUTEX_WAIT to implement a multiprocess mutex. One question I have is whether the kernel allocates a separate kernel space for each process when multiple processes simultaneously instantiate io_uring_queue_init, or do all processes share a single kernel space where all io_uring requests are handled?

axboe commented 1 week ago

Each ring is using its own memory, there's nothing shared across rings. But for futex operations, that should not matter, all that matters is that the futex itself is located in memory that both can access.

NathanFreeman commented 1 week ago

Thank you