Skip to main content

Commpage

Struct Commpage 

Source
pub struct Commpage { /* private fields */ }
Expand description

Handle to a commpage backed by shared memory.

Implementations§

Source§

impl Commpage

Source

pub fn create() -> Result<Self, CommpageError>

Create a new commpage with a unique OS name. Initializes header and both cursors.

Source

pub fn open(name: &str) -> Result<Self, CommpageError>

Open an existing commpage by its OS identifier. Validates magic and version.

Source

pub fn os_id(&self) -> &str

Get the OS identifier for this shared memory region.

Source

pub fn set_cursor_value(&mut self, role: Role, sample_no: u64)

Advance this role’s cursor after completing a sample.

Source

pub fn wait_for_cursor_value(&self, role: Role, target: u64) -> bool

Spin-wait until the peer’s cursor reaches at least target, or the peer sets DONE.

Returns true if the peer caught up, false if the peer exited early (DONE).

Source

pub fn mark_done(&mut self, role: Role)

Mark this role’s cursor as done.

Source

pub fn is_done(&self, role: Role) -> bool

Check if this role’s cursor has the DONE bit set.

Source

pub fn is_some_done(&self) -> bool

Either candidate or baseline has DONE bit set.

Source

pub fn load_cursor_value(&self, role: Role) -> usize

Read the sample counter for a given role (cursor value without the DONE bit). Sample counter is the number of a sample the children is collecting right now. 0 means that measurement has not start yet.

Source

pub fn set_stop(&mut self)

Set the STOP flag. Called by runner to signal time-budget exhaustion.

Source

pub fn is_stopped(&self) -> bool

Check if the STOP flag is set.

Source

pub fn reset(&mut self)

Reset the commpage for a new benchmark run.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V