|
quickpool
0.2.0
An easy-to-use, header-only work stealing thread pool in C++11
|
Todo list - a synchronization primitive. More...
#include <quickpool.hpp>
Public Member Functions | |
| TodoList (size_t num_tasks=0) noexcept | |
| void | add (size_t num_tasks=1) noexcept |
| void | cross (size_t num_tasks=1) |
| bool | empty () const noexcept |
| checks whether list is empty. | |
| void | wait (size_t millis=0) |
| void | stop (std::exception_ptr eptr=nullptr) noexcept |
Todo list - a synchronization primitive.
Add a task with add(), cross it off with cross(), and wait for all tasks to complete with wait().
Definition at line 36 of file quickpool.hpp.
|
inlinenoexcept |
constructs the todo list.
| num_tasks | initial number of tasks. |
Definition at line 41 of file quickpool.hpp.
|
inlinenoexcept |
adds tasks to the list.
| num_tasks | add that many tasks to the list. |
Definition at line 47 of file quickpool.hpp.
|
inline |
crosses tasks from the list.
| num_tasks | cross that many tasks to the list. |
Definition at line 51 of file quickpool.hpp.
|
inlinenoexcept |
stops the list; it will forever look empty from now on.
| eptr | (optional) pointer to an active exception to be rethrown by a waiting thread; typically retrieved from std::current_exception(). |
Definition at line 85 of file quickpool.hpp.
|
inline |
waits for the list to be empty.
| millis | if > 0; waiting aborts after waiting that many milliseconds. |
Definition at line 68 of file quickpool.hpp.
1.8.17