Lockless Task Scheduler  v1.0a
A lockless task scheduler
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
task_scheduler::base_thread< TMemInterface > Struct Template Reference

Struct base_thread More...

#include <thread.h>

Inheritance diagram for task_scheduler::base_thread< TMemInterface >:
Inheritance graph
[legend]
Collaboration diagram for task_scheduler::base_thread< TMemInterface >:
Collaboration graph
[legend]

Public Types

typedef base_task_graph< TMemInterface > task_graph_type
 
typedef base_task< TMemInterface >::task_type task_type
 
typedef task_graph_type::task_queue_type task_queue_type
 
typedef base_thread< TMemInterface > thread_type
 
typedef base_thread_pool< TMemInterface > thread_pool
 
typedef task_graph_type::task_memory_allocator_type task_memory_allocator_type
 
typedef thread_index_t< TMemInterface > thread_index_type
 
typedef task_graph_type::task_vector task_vector
 

Public Member Functions

 base_thread (thread_num_t _thread_index, thread_pool *_pool)
 Initializes a new instance of the base_thread<TMemInterface> struct. More...
 
 ~base_thread ()
 Finalizes an instance of the base_thread<TMemInterface> class. More...
 
void sleep (bool(thread_type::*_wake_up)())
 Sleeps the specified wake up. More...
 
void wake_up ()
 Wakes up. More...
 
void join ()
 Joins this instance. More...
 

Static Public Member Functions

static thread_typecreate_thread (thread_pool *_pool)
 Creates the thread. More...
 

Public Attributes

task_queue_typetask_queue [task_type::num_priority]
 
thread_index_type thread_index
 The task queue More...
 
std::thread::id thread_id
 The thread identifier More...
 
std::thread task_thread
 The task thread More...
 
task_memory_allocator_type allocator
 The allocator More...
 

Friends

class std::thread
 
template<class TMemInterface >
class base_thread_pool
 

Detailed Description

template<class TMemInterface>
struct task_scheduler::base_thread< TMemInterface >

Struct base_thread

Constructor & Destructor Documentation

◆ base_thread()

template<class TMemInterface >
task_scheduler::base_thread< TMemInterface >::base_thread ( thread_num_t  _thread_index,
thread_pool _pool 
)

Initializes a new instance of the base_thread<TMemInterface> struct.

Parameters
_thread_indexIndex of the thread.
_poolThe pool.

◆ ~base_thread()

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

Finalizes an instance of the base_thread<TMemInterface> class.

Member Function Documentation

◆ create_thread()

template<class TMemInterface >
base_thread< TMemInterface > * task_scheduler::base_thread< TMemInterface >::create_thread ( thread_pool _pool)
static

Creates the thread.

Parameters
_poolThe pool.
Returns
thread_type *.

◆ join()

template<class TMemInterface >
void task_scheduler::base_thread< TMemInterface >::join ( )

Joins this instance.

◆ sleep()

template<class TMemInterface >
void task_scheduler::base_thread< TMemInterface >::sleep ( bool(thread_type::*)()  _wake_up)

Sleeps the specified wake up.

Parameters
_wake_upThe wake up.

◆ wake_up()

template<class TMemInterface >
void task_scheduler::base_thread< TMemInterface >::wake_up ( )

Wakes up.

Member Data Documentation

◆ allocator

template<class TMemInterface >
task_memory_allocator_type task_scheduler::base_thread< TMemInterface >::allocator

The allocator

◆ task_thread

template<class TMemInterface >
std::thread task_scheduler::base_thread< TMemInterface >::task_thread

The task thread

◆ thread_id

template<class TMemInterface >
std::thread::id task_scheduler::base_thread< TMemInterface >::thread_id

The thread identifier

◆ thread_index

template<class TMemInterface >
thread_index_type task_scheduler::base_thread< TMemInterface >::thread_index

The task queue


The documentation for this struct was generated from the following files: