Trait rayon_core::job::Job

source ·
pub(crate) trait Job {
    // Required method
    unsafe fn execute(this: *const ());
}
Expand description

A Job is used to advertise work for other threads that they may want to steal. In accordance with time honored tradition, jobs are arranged in a deque, so that thieves can take from the top of the deque while the main worker manages the bottom of the deque. This deque is managed by the thread_pool module.

Required Methods§

source

unsafe fn execute(this: *const ())

Unsafe: this may be called from a different thread than the one which scheduled the job, so the implementer must ensure the appropriate traits are met, whether Send, Sync, or both.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Job for JobFifo

source§

impl<BODY> Job for ArcJob<BODY>
where BODY: Fn() + Send + Sync,

source§

impl<BODY> Job for HeapJob<BODY>
where BODY: FnOnce() + Send,

source§

impl<L, F, R> Job for StackJob<L, F, R>
where L: Latch + Sync, F: FnOnce(bool) -> R + Send, R: Send,