Skip to main content

Module scope

Module scope 

Source
Expand description

Methods for custom fork-join scopes, created by the scope() and in_place_scope() functions. These are a more flexible alternative to join().

Re-exportsΒ§

use std::any::Any; πŸ”’
use std::collections::HashSet; πŸ”’
use std::marker::PhantomData; πŸ”’
use std::mem::ManuallyDrop; πŸ”’
use std::sync::atomic::AtomicPtr; πŸ”’
use std::sync::atomic::Ordering; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::Mutex; πŸ”’
use std::fmt; πŸ”’
use std::ptr; πŸ”’
use crate::broadcast::BroadcastContext; πŸ”’
use crate::job::ArcJob; πŸ”’
use crate::job::HeapJob; πŸ”’
use crate::job::JobFifo; πŸ”’
use crate::job::JobRef; πŸ”’
use crate::job::JobRefId; πŸ”’
use crate::latch::CountLatch; πŸ”’
use crate::latch::Latch; πŸ”’
use crate::registry::Registry; πŸ”’
use crate::registry::WorkerThread; πŸ”’
use crate::registry::global_registry; πŸ”’
use crate::registry::in_worker; πŸ”’
use crate::tlv; πŸ”’
use crate::tlv::Tlv; πŸ”’
use crate::unwind; πŸ”’

StructsΒ§

Scope
Represents a fork-join scope which can be used to spawn any number of tasks. See scope() for more information.
ScopeBase πŸ”’
ScopeFifo
Represents a fork-join scope which can be used to spawn any number of tasks. Those spawned from the same thread are prioritized in relative FIFO order. See scope_fifo() for more information.
ScopePtr πŸ”’
Used to capture a scope &Self pointer in jobs, without faking a lifetime.

FunctionsΒ§

do_in_place_scope πŸ”’
do_in_place_scope_fifo πŸ”’
in_place_scope
Creates a β€œfork-join” scope s and invokes the closure with a reference to s. This closure can then spawn asynchronous tasks into s. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into s. When the closure returns, it will block until all tasks that have been spawned into s complete.
in_place_scope_fifo
Creates a β€œfork-join” scope s with FIFO order, and invokes the closure with a reference to s. This closure can then spawn asynchronous tasks into s. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into s. When the closure returns, it will block until all tasks that have been spawned into s complete.
scope
Creates a β€œfork-join” scope s and invokes the closure with a reference to s. This closure can then spawn asynchronous tasks into s. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into s. When the closure returns, it will block until all tasks that have been spawned into s complete.
scope_fifo
Creates a β€œfork-join” scope s with FIFO order, and invokes the closure with a reference to s. This closure can then spawn asynchronous tasks into s. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into s. When the closure returns, it will block until all tasks that have been spawned into s complete.