Skip to main content

WorkspaceProvider

Trait WorkspaceProvider 

Source
pub trait WorkspaceProvider: Sealed + Sync {
    // Required methods
    fn with_worker(
        &self,
        req: &WorkspaceReq,
        f: &mut dyn FnMut(*mut u8, *mut u8, &mut Vec<i64>),
    );
    fn take_team(
        &self,
        req: &WorkspaceReq,
        pm: usize,
        pn: usize,
    ) -> TeamLease<'_>;
    fn trim(&self);
}
Expand description

Storage an execution may borrow. Implemented by the owner; the driver only ever sees this trait, so nothing here depends on the driver.

Sealed: ArenaProvider is the supported way to lend reusable storage, and the trait is deliberately not implementable outside this crate.

Required Methods§

Source

fn with_worker( &self, req: &WorkspaceReq, f: &mut dyn FnMut(*mut u8, *mut u8, &mut Vec<i64>), )

Run f with this thread’s A block, tile and scatter scratch. A re-entrant call on the same thread gets fresh buffers instead of the ones its outer call is using.

Source

fn take_team(&self, req: &WorkspaceReq, pm: usize, pn: usize) -> TeamLease<'_>

Take the team set for pm x pn, exclusively, until the lease drops.

Source

fn trim(&self)

Release idle storage. Live leases and checked-out worker slots are kept.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§