std::thread::spawn function

E440681

The std::thread::spawn function in Rust is a standard library API that creates and runs a new OS thread to execute a given closure concurrently with the current thread.

All labels observed (1)

Label Occurrences
std::thread::spawn function canonical 1

How this entity was disambiguated

Statements (42)

Predicate Object
instanceOf Rust standard library function ⓘ
alternative std::thread::Builder::spawn for configured threads ⓘ
belongsTo std::thread namespace ⓘ
category thread creation API ⓘ
commonPattern move closures capturing data by value ⓘ
concurrencyModel native OS threads ⓘ
coordination joined via JoinHandle::join ⓘ
creates operating system thread ⓘ
definedIn Rust standard library ⓘ
linked to: Rust
definedInModule std::thread ⓘ
documentationUrl https://doc.rust-lang.org/std/thread/fn.spawn.html ⓘ
effect starts executing closure immediately after thread creation ⓘ
errorHandling panics in spawned thread do not panic parent thread ⓘ
executes closure ⓘ
executesConcurrentlyWith current thread ⓘ
genericOver closure return type T ⓘ
implementationDetail may use platform-specific threading primitives ⓘ
introducedIn Rust 1.0 stable ⓘ
linked to: Rust
lifetimeRequirement captured data must outlive spawned thread ⓘ
namespacePath ::std::thread::spawn ⓘ
ownershipModel moves captured values into new thread ⓘ
panicPropagation panic payload is returned via JoinHandle::join ⓘ
programmingLanguage Rust ⓘ
requires closure argument to implement Send ⓘ
closure return type T to implement Send ⓘ
closure to have 'static lifetime ⓘ
std crate to be available ⓘ
returns std::thread::JoinHandle ⓘ
returnType std::thread::JoinHandle<T> ⓘ
runs closure to completion on spawned thread ⓘ
safety safe Rust function ⓘ
scheduling relies on operating system thread scheduler ⓘ
signatureExample pub fn spawn<F, T>(f: F) -> JoinHandle<T> where F: FnOnce() -> T + Send + 'static, T: Send + 'static ⓘ
spawns new thread of execution ⓘ
stability stable API ⓘ
synchronization often used with Mutex and Arc ⓘ
often used with channels ⓘ
threadModel 1:1 mapping between Rust threads and OS threads ⓘ
threadType non-detached by default ⓘ
usedFor background tasks ⓘ
concurrent execution ⓘ
parallel computation ⓘ

How these facts were elicited

Referenced by (1)

Full triples — surface form annotated when it differs from this entity's canonical label.

std (Rust crate) → contains → std::thread::spawn function ⓘ
subject linked to: std