Module uring

Module uring 

Source
Expand description

Core io_uring wrapper providing async file operations.

This module implements a thread-safe, async-compatible wrapper around Linux’s io_uring interface. It uses a dedicated submission thread and completion thread to manage the ring, allowing multiple async tasks to share a single ring instance.

§Architecture

┌─────────────┐     ┌──────────────────┐     ┌─────────────────┐
│ Async Tasks │────▶│ Submission Thread │────▶│    io_uring     │
│  (callers)  │     │  (batches SQEs)   │     │ (kernel space)  │
└─────────────┘     └──────────────────┘     └────────┬────────┘
       ▲                                              │
       │            ┌──────────────────┐              │
       └────────────│ Completion Thread │◀────────────┘
                    │  (polls CQEs)     │
                    └──────────────────┘

§Thread Safety

The Uring struct is Clone + Send + Sync. Cloning is cheap (just clones the internal channel sender). All operations are thread-safe.

Modules§

advice
fadvise advice values. These are the standard POSIX fadvise constants.
falloc
fallocate mode flags.

Structs§

ReadResult
Result of a read operation: the buffer and actual bytes read.
Uring
Handle to a shared io_uring instance.
UringCfg
Configuration options for io_uring initialization.
WriteResult
Result of a write operation: the buffer and actual bytes written.