pub enum ConcurrencyLowering {
Ucontext,
Stackless,
}Expand description
How the C-family backend lowers a task’s suspend/resume. One point in the (one-dimensional) knob
lattice; pick with ConcurrencyLowering::for_target.
Variants§
Ucontext
Stackful coroutines via ucontext. Simple codegen, native speed, arbitrary nesting; needs
ucontext + a full stack per task. Host / RISC-V / Tenstorrent.
Stackless
A stackless state machine. Universal (device / WASM / embedded), tiny frames, cheap yields; complex codegen + a small per-resume dispatch cost. CUDA / WASM.
Implementations§
Source§impl ConcurrencyLowering
impl ConcurrencyLowering
Sourcepub fn for_target(target: CTarget) -> Self
pub fn for_target(target: CTarget) -> Self
The best-general lowering each target CAN express. A target without ucontext is FORCED to
ConcurrencyLowering::Stackless; a target that has it defaults to ConcurrencyLowering::Ucontext
(simpler codegen + native speed — the right general call when portability is not at stake).
Sourcepub fn tradeoffs() -> &'static [ConcurrencyTradeoff]
pub fn tradeoffs() -> &'static [ConcurrencyTradeoff]
The trade-off table — one row per setting, each naming where it wins and where it loses. The concurrency-knob lock asserts this stays complete and honest (neither setting is strictly better, which is exactly why this is a knob and not a baked-in choice).
Trait Implementations§
Source§impl Clone for ConcurrencyLowering
impl Clone for ConcurrencyLowering
Source§fn clone(&self) -> ConcurrencyLowering
fn clone(&self) -> ConcurrencyLowering
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConcurrencyLowering
impl Debug for ConcurrencyLowering
Source§impl PartialEq for ConcurrencyLowering
impl PartialEq for ConcurrencyLowering
impl Copy for ConcurrencyLowering
impl Eq for ConcurrencyLowering
impl StructuralPartialEq for ConcurrencyLowering
Auto Trait Implementations§
impl Freeze for ConcurrencyLowering
impl RefUnwindSafe for ConcurrencyLowering
impl Send for ConcurrencyLowering
impl Sync for ConcurrencyLowering
impl Unpin for ConcurrencyLowering
impl UnsafeUnpin for ConcurrencyLowering
impl UnwindSafe for ConcurrencyLowering
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.