Lockless Task Scheduler  v1.0a
A lockless task scheduler
Public Types | Public Member Functions | Protected Member Functions | List of all members
task_scheduler::base_worker_task< TMemInterface > Class Template Reference
Inheritance diagram for task_scheduler::base_worker_task< TMemInterface >:
Inheritance graph
[legend]
Collaboration diagram for task_scheduler::base_worker_task< TMemInterface >:
Collaboration graph
[legend]

Public Types

typedef base_task< TMemInterface > super
 
typedef base_worker_task< TMemInterface > worker_task_type
 
typedef base_task< TMemInterface > super
 
- Public Types inherited from task_scheduler::base_task< TMemInterface >
enum  priority_selector {
  realtime, high, normal, low,
  num_priority
}
 Enum priority_selector More...
 
typedef base_task< TMemInterface > task_type
 
typedef base_thread< TMemInterface > thread_type
 
typedef base_task_graph< TMemInterface > task_graph_type
 
typedef base_sub_graph< task_type, TMemInterface > sub_graph_type
 
typedef std::basic_string< tchar_t, std::char_traits< tchar_t >, stl_allocator< tchar_t, TMemInterface > > string_type
 
typedef std::vector< string_type, stl_allocator< string_type, TMemInterface > > string_vector
 
typedef std::vector< task_type *, stl_allocator< task_type *, TMemInterface > > task_vector
 
typedef base_thread_pool< TMemInterface > thread_pool
 
typedef std::function< void() > function_type
 
typedef int64_t rank_type
 
typedef std::vector< function_type > task_work_vector
 
typedef thread_index_t< TMemInterface > thread_index_type
 
typedef lock_free_node_dispenser< function_type *, TMemInterface > work_memory_allocator_type
 
typedef lock_free_queue< multi_producer_multi_consumer< function_type *, TMemInterface, work_memory_allocator_type >, function_type *, TMemInterface, work_memory_allocator_type *> work_queue_type
 

Public Member Functions

 base_worker_task (typename super::task_graph_type &_task_graph)
 Initializes a new instance of the base_worker_task class. More...
 
 ~base_worker_task ()
 Finalizes an instance of the base_worker_task class. More...
 
- Public Member Functions inherited from task_scheduler::base_task< TMemInterface >
 base_task (task_graph_type &_task_graph)
 Initializes a new instance of the base_task class. More...
 
virtual ~base_task ()
 Finalizes an instance of the base_task class. More...
 
void set_thread_affinity (thread_mask_int_t _mask)
 Sets the thread affinity. More...
 
void set_thread_exclusion (thread_mask_int_t _mask)
 Sets the thread exclusion. More...
 
void set_num_workers (thread_num_t _num_workers)
 Sets the number workers. More...
 
void set_num_workers (percentage_t _percentage_workers)
 Sets the number workers. More...
 
void kick_dependent_tasks ()
 Kicks the dependent tasks. More...
 
bool add_task_parallel_work (function_type _work_function)
 Adds the task parallel work. More...
 
bool link_task (task_type *_next_task)
 Links the task. More...
 
bool operator() ()
 Operator()s this instance. More...
 

Protected Member Functions

bool run () override
 Callback to run task More...
 
- Protected Member Functions inherited from task_scheduler::base_task< TMemInterface >
virtual void before_scheduled (thread_num_t _scheduled_on_num_workers)
 Callback is called when a task is scheduled More...
 
virtual void after_run ()
 Callback is called after a task is run More...
 

Additional Inherited Members

- Public Attributes inherited from task_scheduler::base_task< TMemInterface >
debug_container debug
 The debug More...
 
transient_container transient
 The transient More...
 
persistent_container persistent
 The persistent More...
 
task_graph_typetask_graph
 The task graph More...
 
thread_unsafe_access_storage add_task_parallel_work_detector
 The add task parallel work detector More...
 

Constructor & Destructor Documentation

◆ base_worker_task()

template<class TMemInterface >
task_scheduler::base_worker_task< TMemInterface >::base_worker_task ( typename super::task_graph_type _task_graph)

Initializes a new instance of the base_worker_task class.

Parameters
_task_graphThe task graph.

◆ ~base_worker_task()

template<class TMemInterface >
task_scheduler::base_worker_task< TMemInterface >::~base_worker_task ( )

Finalizes an instance of the base_worker_task class.

Member Function Documentation

◆ run()

template<class TMemInterface >
bool task_scheduler::base_worker_task< TMemInterface >::run ( )
overrideprotectedvirtual

Callback to run task

Implements task_scheduler::base_task< TMemInterface >.


The documentation for this class was generated from the following file: