-
Notifications
You must be signed in to change notification settings - Fork 7
thread_pool execute
Alairion edited this page May 11, 2021
·
3 revisions
nes::thread_pool::execute
template<typename Func, typename... Args>
(1) void execute(Func&& func, Args&&... args);
- Pushes a task in the thread pool, without returning a future (it saves a promise allocation). The return value of the function, if any, will be discarded. Synchronization of execute tasks can be done using user-specific operations inside the function or
nes::thread_pool::wait_idle
. The function will be called as-if by callingstd::invoke(func, args...);
. The arguments to the function are moved or copied by value, if a reference argument needs to be passed, it has to be wrapped using std::[c]ref, or any other wrapper.
Name | Description |
---|---|
func |
The function to be executed. |
args |
The arguments to be passed to func . |
None.
-
func
must be movable, andstd::invoke(func, args...);
must be well-formed.
May throw a std::bad_alloc
or std::system_error
.