pub struct RingPool { /* private fields */ }Expand description
Assistant thread-per-core : crée N IoUring cohérents en partageant
le pool io-wq (ATTACH_WQ, Temps 3a) — le nombre total de threads workers
kernel est borné quel que soit N (crucial sur matériel modeste, Pi 4)
— et en enregistrant les ring fds (Temps 3a) pour le routage msg_ring.
RingPool organise, ne partage pas : chaque IoUring rendu reste
Send/!Sync et est déplacé dans son thread, jamais partagé.
Implementations§
Source§impl RingPool
impl RingPool
Sourcepub fn new(workers: NonZeroUsize, entries: NonZeroU32) -> Result<Self, Errno>
pub fn new(workers: NonZeroUsize, entries: NonZeroU32) -> Result<Self, Errno>
Crée workers rings : le premier crée le pool io-wq, les suivants
s’y attachent (ATTACH_WQ) → nombre total de threads workers kernel borné.
Chaque ring fd est enregistré (REGISTER_RING_FDS, Temps 3a).
§Errors
Erreurs d’io_uring_setup/io_uring_register (cf. IoUringBuilder::build,
IoUring::register_ring_fd).
Sourcepub fn into_rings(self) -> Vec<IoUring>
pub fn into_rings(self) -> Vec<IoUring>
Distribue les rings : un IoUring possédé par worker, à déplacer
dans chaque thread.
Sourcepub fn handle(&self, worker: usize) -> Option<RingHandle>
pub fn handle(&self, worker: usize) -> Option<RingHandle>
Poignée de routage vers le ring du worker worker (cible msg_ring).
None si worker est hors borne.