pub struct WorkerThread<'scope, V, T>where
V: Send,{
pub thread: Option<ScopedJoinHandle<'scope, Vec<T>>>,
pub name: String,
/* private fields */
}Expand description
Worker thread is launched by the thread manager based on the need discovered by the scheduling algorithm within worker controller.
Fields§
§thread: Option<ScopedJoinHandle<'scope, Vec<T>>>§name: StringImplementations§
Source§impl<'scope, V, T> WorkerThread<'scope, V, T>
impl<'scope, V, T> WorkerThread<'scope, V, T>
pub fn launch<'env, 'a, F>( scope: &'scope Scope<'scope, 'env>, pos: usize, f: Arc<RwLock<F>>, ) -> Result<Self, Box<dyn Error>>
pub fn name(&self) -> &String
pub fn signal(&mut self, state: Coordination)
pub fn is_running(&mut self) -> bool
Sourcepub fn run(&mut self, values: Vec<V>) -> Result<(), WorkThreadError>
pub fn run(&mut self, values: Vec<V>) -> Result<(), WorkThreadError>
Run function runs a new batch of tasks on the thread
pub fn pos(&self) -> usize
pub fn unpark(&self)
pub fn join(self) -> Result<Vec<T>, Box<dyn Any + Send + 'static>>
pub fn queue_len(&self) -> usize
pub fn steal(&mut self) -> Option<Vec<V>>
pub fn steal_half(&mut self) -> Option<Vec<V>>
pub fn is_queue_empty(&self) -> bool
pub fn queue_start_len(&self) -> usize
pub fn get_elapsed_time(&mut self) -> Option<u128>
pub fn time_per_process(&self) -> Option<f64>
pub fn predicted_queue_time(&self) -> f64
pub fn ratio_of_tasks_remaining(&self) -> Option<f64>
pub fn projected_time_for_completion( &self, min_ratio_completed: f64, ) -> Option<f64>
Auto Trait Implementations§
impl<'scope, V, T> Freeze for WorkerThread<'scope, V, T>
impl<'scope, V, T> !RefUnwindSafe for WorkerThread<'scope, V, T>
impl<'scope, V, T> Send for WorkerThread<'scope, V, T>
impl<'scope, V, T> Sync for WorkerThread<'scope, V, T>
impl<'scope, V, T> Unpin for WorkerThread<'scope, V, T>
impl<'scope, V, T> !UnwindSafe for WorkerThread<'scope, V, T>
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
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.