Core class that represents a thread pool.
More...
Core class that represents a thread pool.
Core class that represents a pool of threads.
◆ AddTask() [1/3]
template<typename F >
void Nz::TaskScheduler::AddTask |
( |
F |
function | ) |
|
|
static |
Adds a task to the pending list.
- Parameters
-
function | Task that the pool will execute |
◆ AddTask() [2/3]
template<typename F , typename... Args>
void Nz::TaskScheduler::AddTask |
( |
F |
function, |
|
|
Args &&... |
args |
|
) |
| |
|
static |
Adds a task to the pending list.
- Parameters
-
function | Task that the pool will execute |
args | Arguments of the function |
◆ AddTask() [3/3]
template<typename C >
void Nz::TaskScheduler::AddTask |
( |
void(C::*)() |
function, |
|
|
C * |
object |
|
) |
| |
|
static |
Adds a task to the pending list.
- Parameters
-
function | Task that the pool will execute |
object | Object on which the method will be called |
◆ GetWorkerCount()
unsigned int Nz::TaskScheduler::GetWorkerCount |
( |
| ) |
|
|
static |
Gets the number of threads.
- Returns
- Number of threads, if none, the number of simulatenous threads on the processor is returned
◆ Initialize()
bool Nz::TaskScheduler::Initialize |
( |
| ) |
|
|
static |
Initializes the TaskScheduler class.
- Returns
- true if everything is ok
◆ Run()
void Nz::TaskScheduler::Run |
( |
| ) |
|
|
static |
◆ SetWorkerCount()
void Nz::TaskScheduler::SetWorkerCount |
( |
unsigned int |
workerCount | ) |
|
|
static |
Sets the number of workers.
- Parameters
-
workerCount | Number of simulatnous threads handling the tasks |
◆ WaitForTasks()
void Nz::TaskScheduler::WaitForTasks |
( |
| ) |
|
|
static |
Waits for tasks to be done.
The documentation for this class was generated from the following files:
- include/Nazara/Core/TaskScheduler.hpp
- include/Nazara/Core/TaskScheduler.inl
- src/Nazara/Core/TaskScheduler.cpp