[−][src]Struct liriodendron::task::tasksmanager::TasksManager
Multi-threaded struct to support expensive users queries and avoid blocking tasks
Fields
nb_running_threads: Arc<Mutex<usize>>
Running threads counter
waiting_tasks: Arc<Mutex<usize>>
Queue's length
is_sending: Arc<Mutex<bool>>
When true, threads send their progression
threadpool: ThreadPool
sender: Sender<Option<(ThreadId, (u16, u16))>>
receiver: Receiver<Option<(ThreadId, (u16, u16))>>
tasks: VecDeque<Box<dyn Task + Send>>
Waiting tasks are stocked in this queue
todo_tasks: usize
done_tasks: usize
threads_monitor: HashMap<ThreadId, (u16, u16)>
Stocks threads' progression
threads_number: usize
Customizable member
max_tasks: usize
Customizable member
Methods
impl TasksManager
[src]
pub fn new(threads_number: usize, max_tasks: usize) -> TasksManager
[src]
pub fn new_generation_task(&mut self, log: &Log) -> (Result<()>, bool)
[src]
fn get_nb_running_threads(&self) -> usize
[src]
pub fn get_todo_and_max_tasks(&self) -> (usize, usize)
[src]
pub fn get_done_and_todo_tasks(&self) -> (usize, usize)
[src]
pub fn check_queue(&mut self)
[src]
Checks if a task is in the queue. If a thread is available, it runs the task and pop it from the queue.
pub fn start_sender_channel(&mut self)
[src]
pub fn compute_todotasks(&mut self)
[src]
pub fn spawn_unlocking_thread(&self)
[src]
Unlocks a blocking std::sync::mpsc::Receiver.recv() call
pub fn shutdown(self)
[src]
pub fn get_threads_monitor(&self) -> &HashMap<ThreadId, (u16, u16)>
[src]
pub fn is_running(&mut self) -> bool
[src]
While the receiver is receiving data from the threadpool, a thread is running
Auto Trait Implementations
impl !RefUnwindSafe for TasksManager
impl Send for TasksManager
impl !Sync for TasksManager
impl Unpin for TasksManager
impl !UnwindSafe for TasksManager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,