|
dispenso 1.6.2
A library for task parallelism
|
#include <schedulable.h>
Public Member Functions | |
| template<typename F > | |
| void | schedule (F &&f) const |
| template<typename F > | |
| void | schedule (F &&f, ForceQueuingTag) const |
A class fullfilling the Schedulable concept that always invokes on a new thread. This can be used in place of ThreadPool or TaskSet with Futures at construction or through then.
Definition at line 98 of file schedulable.h.
|
inline |
Schedule a functor to be executed on a new thread.
| f | The functor to be executed. f's signature must match void(). Best performance will come from passing lambdas, other concrete functors, or OnceFunction, but std::function or similarly type-erased objects will also work. |
schedule hands back no handle, so threads still running when the process exits are joined automatically. Prefer synchronizing on completion yourself where you can: the automatic drain runs with the static destructors of whichever module called schedule, so it only runs early enough to help when that module is the executable. A process that reaches NewThreadInvoker solely from within shared libraries has no drain that beats process teardown.
Definition at line 116 of file schedulable.h.
|
inline |
Schedule a functor to be executed on a new thread.
| f | The functor to be executed. f's signature must match void(). Best performance will come from passing lambdas, other concrete functors, or OnceFunction, but std::function or similarly type-erased objects will also work. |
Definition at line 128 of file schedulable.h.