Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
#include <task_arena.h>
Classes | |
struct | attach |
Tag class used to indicate the "attaching" constructor. More... | |
Public Member Functions | |
task_arena (int max_concurrency_=automatic, unsigned reserved_for_masters=1) | |
Creates task_arena with certain concurrency limits. More... | |
task_arena (const task_arena &s) | |
Copies settings from another task_arena. More... | |
task_arena (attach) | |
Creates an instance of task_arena attached to the current arena of the thread. More... | |
void | initialize () |
Forces allocation of the resources for the task_arena as specified in constructor arguments. More... | |
void | initialize (int max_concurrency_, unsigned reserved_for_masters=1) |
Overrides concurrency level and forces initialization of internal representation. More... | |
void | initialize (attach) |
Attaches this instance to the current arena of the thread. More... | |
void | terminate () |
~task_arena () | |
bool | is_active () const |
template<typename F > | |
void | enqueue (F &&f) |
template<typename F > | |
__TBB_DEPRECATED void | enqueue (F &&f, priority_t p) |
template<typename F > | |
internal::return_type_or_void< F >::type | execute (F &f) |
template<typename F > | |
internal::return_type_or_void< F >::type | execute (const F &f) |
int | max_concurrency () const |
Returns the maximal number of threads that can work inside the arena. More... | |
Static Public Member Functions | |
static int | current_thread_index () |
Private Member Functions | |
void | mark_initialized () |
template<typename F > | |
void | enqueue_impl (__TBB_FORWARDING_REF(F) f, priority_t p=priority_t(0)) |
template<typename R , typename F > | |
R | execute_impl (F &f) |
Private Attributes | |
bool | my_initialized |
Friends | |
class | tbb::internal::task_scheduler_observer_v3 |
void | task::enqueue (task &, task_arena &, priority_t) |
int | tbb::this_task_arena::max_concurrency () |
1-to-1 proxy representation class of scheduler's arena Constructors set up settings only, real construction is deferred till the first method invocation Destructor only removes one of the references to the inner arena representation. Final destruction happens when all the references (and the work) are gone.
Definition at line 172 of file task_arena.h.
|
inline |
Creates task_arena with certain concurrency limits.
Sets up settings only, real construction is deferred till the first method invocation
Definition at line 227 of file task_arena.h.
|
inline |
Copies settings from another task_arena.
Definition at line 233 of file task_arena.h.
|
inlineexplicit |
Creates an instance of task_arena attached to the current arena of the thread.
Definition at line 242 of file task_arena.h.
|
inline |
Removes the reference to the internal arena representation, and destroys the external object. Not thread safe wrt concurrent invocations of other methods.
Definition at line 291 of file task_arena.h.
|
inlinestatic |
Returns the index, aka slot number, of the calling thread in its current arena This method is deprecated and replaced with this_task_arena::current_thread_index()
Definition at line 371 of file task_arena.h.
Referenced by tbb::this_task_arena::current_thread_index().
|
inline |
Enqueues a task into the arena to process a functor, and immediately returns. Does not require the calling thread to join the arena
Definition at line 304 of file task_arena.h.
|
inline |
Enqueues a task with priority p into the arena to process a functor f, and immediately returns. Does not require the calling thread to join the arena
Definition at line 319 of file task_arena.h.
References __TBB_ASSERT, __TBB_DEPRECATED, p, tbb::internal::priority_critical, tbb::priority_high, tbb::priority_low, and tbb::priority_normal.
|
inlineprivate |
Definition at line 196 of file task_arena.h.
References tbb::task::allocate_root(), and p.
|
inline |
Joins the arena and executes a mutable functor, then returns If not possible to join, wraps the functor into a task, enqueues it and waits for task completion Can decrement the arena demand for workers, causing a worker to leave and free a slot to the calling thread Since C++11, the method returns the value returned by functor (prior to C++11 it returns void).
Definition at line 346 of file task_arena.h.
References type.
Referenced by tbb::flow::interface11::internal::spawn_in_graph_arena().
|
inline |
Joins the arena and executes a constant functor, then returns If not possible to join, wraps the functor into a task, enqueues it and waits for task completion Can decrement the arena demand for workers, causing a worker to leave and free a slot to the calling thread Since C++11, the method returns the value returned by functor (prior to C++11 it returns void).
Definition at line 355 of file task_arena.h.
References type.
|
inlineprivate |
Definition at line 213 of file task_arena.h.
References tbb::interface7::internal::delegated_function< F, R >::consume_result(), and d.
|
inline |
Forces allocation of the resources for the task_arena as specified in constructor arguments.
Definition at line 251 of file task_arena.h.
Referenced by tbb::task::enqueue().
|
inline |
Overrides concurrency level and forces initialization of internal representation.
Definition at line 259 of file task_arena.h.
References __TBB_ASSERT.
Attaches this instance to the current arena of the thread.
Definition at line 270 of file task_arena.h.
References __TBB_ASSERT.
|
inline |
Returns true if the arena is active (initialized); false otherwise. The name was chosen to match a task_scheduler_init method with the same semantics.
Definition at line 297 of file task_arena.h.
Referenced by tbb::flow::interface11::internal::enqueue_in_graph_arena(), and tbb::flow::interface11::internal::spawn_in_graph_arena().
|
inlineprivate |
Definition at line 181 of file task_arena.h.
References __TBB_ASSERT, tbb::internal::as_atomic(), and tbb::release.
|
inline |
Returns the maximal number of threads that can work inside the arena.
Definition at line 376 of file task_arena.h.
|
inline |
Removes the reference to the internal arena representation. Not thread safe wrt concurrent invocations of other methods.
Definition at line 282 of file task_arena.h.
|
friend |
|
friend |
Definition at line 173 of file task_arena.h.
|
friend |
|
private |
Definition at line 180 of file task_arena.h.