Skip to main content

RingPool

Struct RingPool 

Source
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

Source

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).

Source

pub fn into_rings(self) -> Vec<IoUring>

Distribue les rings : un IoUring possédé par worker, à déplacer dans chaque thread.

Source

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.

Trait Implementations§

Source§

impl Debug for RingPool

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.