|
Lockless Task Scheduler
v1.0a
A lockless task scheduler
|
Class base_task_graph. More...
#include <taskgraph.h>


Classes | |
| struct | debug_container |
| Struct debug_container More... | |
| struct | persistent_container |
| Struct persistent_container More... | |
| class | task_queue_type |
| struct | transient_container |
| Struct transient_container More... | |
Public Types | |
| typedef base_task< TMemInterface > | task_type |
| typedef std::basic_string< tchar_t, std::char_traits< tchar_t >, stl_allocator< tchar_t, TMemInterface > > | string_type |
| typedef base_sub_graph< task_type, TMemInterface > | sub_graph_type |
| typedef lock_free_node_dispenser< task_type *, TMemInterface > | task_memory_allocator_type |
| typedef lock_free_queue< multi_producer_multi_consumer< task_type *, TMemInterface, task_memory_allocator_type >, typename base_task< TMemInterface >::task_type *, TMemInterface, task_memory_allocator_type *> | base_task_queue_type |
| typedef std::unordered_map< string_type, task_type *, std::hash< string_type >, std::equal_to< string_type >, stl_allocator< std::pair< const string_type, task_type *>, TMemInterface > > | task_name_to_task_map |
| typedef std::vector< sub_graph_type *, stl_allocator< sub_graph_type *, TMemInterface > > | sub_graph_vector |
| typedef std::vector< task_type *, stl_allocator< task_type *, TMemInterface > > | task_vector |
| typedef base_thread_pool< TMemInterface > | thread_pool |
| typedef task_type * | task_list |
| typedef std::function< void(task_type *, void *&) > | traversal_function_type |
Public Member Functions | |
| base_task_graph (thread_pool &_pool) | |
| Initializes a new instance of the base_task_graph class. More... | |
| ~base_task_graph () | |
| Finalizes an instance of the base_task_graph class. More... | |
| void | setup (sub_graph_type *_sub_graph=nullptr) |
| Setups the specified sub graph. More... | |
| void | load (string_type _file_name) |
| Loads the specified file name. More... | |
| void | initialize () |
| Initializes this instance. More... | |
| void | set_task_thread_affinity (task_type *_task, uint64_t _mask) |
| Sets the task thread affinity. More... | |
| void | set_task_thread_exclusion (task_type *_task, uint64_t _mask) |
| Sets the task thread exclusion. More... | |
| void | set_num_workers (task_type *_task, thread_num_t _num_workers) |
| Sets the number workers. More... | |
| void | set_percentage_of_workers (task_type *_task, float _percentage_workers) |
| Sets the percentage of workers. More... | |
| void | setup_tail_kickers () |
| Setups the tail kickers. More... | |
| void | depth_first_visitor (task_type *_task, traversal_function_type _preorder_functor, traversal_function_type _inorder_functor, traversal_function_type _post_order_functor, traversal_function_type _tail_functor, void *_param, bool _bottom_up=false) |
| Depthes the first visitor. More... | |
| void | kick () |
| Kicks this instance. More... | |
| void | queue_task (task_type *_task, thread_num_t _num_threads_to_wake_up=1) |
| Queues the task. More... | |
| task_type * | dequeue_task (uint32_t _priority) |
| Dequeues the task. More... | |
| bool | is_task_available () |
| Determines whether [is task available]. More... | |
| bool | link_task (task_type *_parent_task, task_type *_dependent_task) |
| Links the task. More... | |
Public Attributes | |
| persistent_container | persistent |
| The persistent More... | |
| transient_container | transient |
| The transient More... | |
| debug_container | debug |
| The debug More... | |
| thread_pool & | pool |
| The pool More... | |
Class base_task_graph.
| task_scheduler::base_task_graph< TMemInterface >::base_task_graph | ( | thread_pool & | _pool | ) |
Initializes a new instance of the base_task_graph class.
| _pool | The pool. |
| task_scheduler::base_task_graph< TMemInterface >::~base_task_graph | ( | ) |
Finalizes an instance of the base_task_graph class.
| void task_scheduler::base_task_graph< TMemInterface >::depth_first_visitor | ( | task_type * | _task, |
| traversal_function_type | _preorder_functor, | ||
| traversal_function_type | _inorder_functor, | ||
| traversal_function_type | _post_order_functor, | ||
| traversal_function_type | _tail_functor, | ||
| void * | _param, | ||
| bool | _bottom_up = false |
||
| ) |
Depthes the first visitor.
| _task | The task. |
| _preorder_functor | The preorder functor. |
| _inorder_functor | The inorder functor. |
| _post_order_functor | The post order functor. |
| _tail_functor | The tail functor. |
| _param | The parameter. |
| _bottom_up | The bottom up. |
| base_task_graph< TMemInterface >::task_type * task_scheduler::base_task_graph< TMemInterface >::dequeue_task | ( | uint32_t | _priority | ) |
Dequeues the task.
| _priority | The priority. |
| void task_scheduler::base_task_graph< TMemInterface >::initialize | ( | ) |
Initializes this instance.
| bool task_scheduler::base_task_graph< TMemInterface >::is_task_available | ( | ) |
Determines whether [is task available].
| void task_scheduler::base_task_graph< TMemInterface >::kick | ( | ) |
Kicks this instance.
| bool task_scheduler::base_task_graph< TMemInterface >::link_task | ( | task_type * | _parent_task, |
| task_type * | _dependent_task | ||
| ) |
Links the task.
| _parent_task | The parent task. |
| _dependent_task | The dependent task. |
| void task_scheduler::base_task_graph< TMemInterface >::load | ( | string_type | _file_name | ) |
Loads the specified file name.
| _file_name | Name of the file. |
| void task_scheduler::base_task_graph< TMemInterface >::queue_task | ( | task_type * | _task, |
| thread_num_t | _num_threads_to_wake_up = 1 |
||
| ) |
Queues the task.
| _task | The task. |
| _num_threads_to_wake_up | The number threads to wake up. |
| void task_scheduler::base_task_graph< TMemInterface >::set_num_workers | ( | task_type * | _task, |
| thread_num_t | _num_workers | ||
| ) |
Sets the number workers.
| _task | The task. |
| _num_workers | The number workers. |
| void task_scheduler::base_task_graph< TMemInterface >::set_percentage_of_workers | ( | task_type * | _task, |
| float | _percentage_workers | ||
| ) |
Sets the percentage of workers.
| _task | The task. |
| _percentage_workers | The percentage workers. |
| void task_scheduler::base_task_graph< TMemInterface >::set_task_thread_affinity | ( | task_type * | _task, |
| uint64_t | _mask | ||
| ) |
Sets the task thread affinity.
| _task | The task. |
| _mask | The mask. |
| void task_scheduler::base_task_graph< TMemInterface >::set_task_thread_exclusion | ( | task_type * | _task, |
| uint64_t | _mask | ||
| ) |
Sets the task thread exclusion.
| _task | The task. |
| _mask | The mask. |
| void task_scheduler::base_task_graph< TMemInterface >::setup | ( | sub_graph_type * | _sub_graph = nullptr | ) |
Setups the specified sub graph.
| _sub_graph | The sub graph. |
| void task_scheduler::base_task_graph< TMemInterface >::setup_tail_kickers | ( | ) |
Setups the tail kickers.
| debug_container task_scheduler::base_task_graph< TMemInterface >::debug |
The debug
| persistent_container task_scheduler::base_task_graph< TMemInterface >::persistent |
The persistent
| thread_pool& task_scheduler::base_task_graph< TMemInterface >::pool |
The pool
| transient_container task_scheduler::base_task_graph< TMemInterface >::transient |
The transient
1.8.13