#include <tbb_scheduler.hpp>
|
| void | help_while_waiting (const WaitPredicate &is_ready) override |
| | Allow a scheduler to advance queued work while a thread is blocking.
|
| |
| void | pause () override |
| | Pause the scheduler. Don't execute scheduled tasks, but instead add them to a queue.
|
| |
| void | resume () override |
| | Unpause the scheduler, and execute any tasks that have been queued.
|
| |
| void | run_all () |
| | Block until all tasks scheduled on this scheduler are complete.
|
| |
| void | schedule (AsyncTask &&t) override |
| | Schedule a coroutine for initial execution.
|
| |
| | TbbScheduler (int max_concurrency=oneapi::tbb::task_arena::automatic, TbbSchedulerBatchOptions batch_options={}) |
| | Construct a TBB scheduler with a given arena concurrency.
|
| |
| | TbbScheduler (oneapi::tbb::task_arena::constraints constraints, TbbSchedulerBatchOptions batch_options={}) |
| | Construct a TBB scheduler constrained to a specific NUMA node.
|
| |
| void | wait_for (const WaitPredicate &is_ready) override |
| | Accept an already-satisfied predicate; pending TBB waits require a WaitRequest notification.
|
| |
| void | wait_for (WaitRequest const &request) override |
| | Wait for targeted readiness while allowing the arena to execute other work.
|
| |
| | ~TbbScheduler () noexcept override |
| |
template<class Function >
requires std::invocable<Function&, std::size_t> |
| void | execute_batch (std::size_t size, Function &&function) |
| | Execute a synchronous batch of independent lightweight work items.
|
| |
| | ~IAsyncScheduler () override=default |
| | Virtual destructor.
|
| |
| virtual | ~IScheduler ()=default |
| | Virtual destructor.
|
| |
◆ TbbScheduler() [1/2]
| uni20::async::TbbScheduler::TbbScheduler |
( |
int |
max_concurrency = oneapi::tbb::task_arena::automatic, |
|
|
TbbSchedulerBatchOptions |
batch_options = {} |
|
) |
| |
|
inlineexplicit |
Construct a TBB scheduler with a given arena concurrency.
- Parameters
-
| max_concurrency | Maximum arena participation, including application threads. Use task_arena::automatic for the oneTBB default. |
| batch_options | Lightweight-batch concurrency policy. |
- Note
- Explicit concurrency one shares its sole slot between application and worker threads; reserving that slot would let oneTBB add a second participant for enqueued work.
◆ TbbScheduler() [2/2]
| uni20::async::TbbScheduler::TbbScheduler |
( |
oneapi::tbb::task_arena::constraints |
constraints, |
|
|
TbbSchedulerBatchOptions |
batch_options = {} |
|
) |
| |
|
inlineexplicit |
Construct a TBB scheduler constrained to a specific NUMA node.
- Parameters
-
| constraints | Binding constraints applied to the underlying arena. |
| batch_options | Lightweight-batch concurrency policy. |
◆ ~TbbScheduler()
| uni20::async::TbbScheduler::~TbbScheduler |
( |
| ) |
|
|
inlineoverridenoexcept |
◆ dispatch_handle()
| virtual void uni20::async::TbbScheduler::dispatch_handle |
( |
TaskHandle |
handle | ) |
|
|
inlineprotectedvirtual |
Route one runnable task activation to its execution arena.
◆ dispatch_handle_in_arena()
template<typename Prepare >
| void uni20::async::TbbScheduler::dispatch_handle_in_arena |
( |
oneapi::tbb::task_arena & |
arena, |
|
|
TaskHandle |
handle, |
|
|
detail::TbbTaskAdmissionContext |
context, |
|
|
Prepare && |
prepare |
|
) |
| |
|
inlineprotected |
Submit one activation to an arena through the shared task group.
- Template Parameters
-
| Prepare | callable that establishes or verifies the arena execution context. |
- Parameters
-
| arena | Arena that will execute the activation. |
| handle | Promise-neutral task identity. |
| context | Diagnostic context for admission failure. |
| prepare | Callable invoked immediately before coroutine resumption. |
◆ enqueue_task()
| void uni20::async::TbbScheduler::enqueue_task |
( |
BasicTask && |
t | ) |
|
|
inlineprotected |
Enqueue one task through the scheduler's domain-routing hook.
◆ help_while_waiting()
| void uni20::async::TbbScheduler::help_while_waiting |
( |
const WaitPredicate & |
is_ready | ) |
|
|
inlineoverridevirtual |
Allow a scheduler to advance queued work while a thread is blocking.
Blocking waits (e.g., Async<T>::get_wait()) call this hook to cooperatively drive progress on the owning scheduler until is_ready() reports completion. The default implementation simply yields the calling thread until the predicate succeeds, which is suitable for schedulers that rely on dedicated worker threads.
Reimplemented from uni20::async::IAsyncScheduler.
◆ pause()
| void uni20::async::TbbScheduler::pause |
( |
| ) |
|
|
inlineoverridevirtual |
◆ resume()
| void uni20::async::TbbScheduler::resume |
( |
| ) |
|
|
inlineoverridevirtual |
◆ run_all()
| void uni20::async::TbbScheduler::run_all |
( |
| ) |
|
|
inline |
Block until all tasks scheduled on this scheduler are complete.
- Note
- This guarantees quiescence with respect to tasks that were scheduled on this TbbScheduler. Tasks blocked on external events (I/O, MPI, etc.) may still be logically alive and will resume later if rescheduled.
◆ schedule()
| void uni20::async::TbbScheduler::schedule |
( |
AsyncTask && |
t | ) |
|
|
inlineoverridevirtual |
◆ wait_for() [1/2]
| void uni20::async::TbbScheduler::wait_for |
( |
const WaitPredicate & |
is_ready | ) |
|
|
inlineoverridevirtual |
◆ wait_for() [2/2]
| void uni20::async::TbbScheduler::wait_for |
( |
WaitRequest const & |
request | ) |
|
|
inlineoverridevirtual |
Wait for targeted readiness while allowing the arena to execute other work.
- Parameters
-
| request | Readiness predicate and race-safe wakeup registration. |
- Exceptions
-
Reimplemented from uni20::async::IAsyncScheduler.
◆ wait_for_submitted_tasks()
| void uni20::async::TbbScheduler::wait_for_submitted_tasks |
( |
| ) |
|
|
inlineprotected |
Wait for every activation registered with the shared task group.
◆ TbbNumaScheduler
The documentation for this class was generated from the following file: