17#ifndef __TBB_task_arena_H
18#define __TBB_task_arena_H
20#define __TBB_task_arena_H_include_area
29#if TBB_USE_THREADING_TOOLS
36namespace this_task_arena {
66#if __TBB_CPP11_DECLTYPE_PRESENT && !__TBB_CPP11_DECLTYPE_OF_FUNCTION_RETURN_TYPE_BROKEN
67 typedef decltype(declval<F>()())
type;
73template<
typename F,
typename R>
106#if __TBB_NUMA_SUPPORT
114 numa_node_id numa_id;
122#if __TBB_TASK_GROUP_CONTEXT
138#if __TBB_NUMA_SUPPORT
140 numa_node_id my_numa_id;
147 numa_node_id numa_id() {
154#if __TBB_TASK_GROUP_CONTEXT
158#
if __TBB_NUMA_SUPPORT
159 , numa_support_flag = 1
170#if __TBB_NUMA_SUPPORT
176#if __TBB_NUMA_SUPPORT
181#if __TBB_NUMA_SUPPORT
182 task_arena_base(
const constraints& constraints_,
unsigned reserved_for_masters)
191 , my_numa_id(constraints_.numa_id )
210#if __TBB_TASK_ISOLATION
213template<
typename R,
typename F>
217 return d.consume_result();
238#if __TBB_TASK_GROUP_CONTEXT
241#if TBB_USE_THREADING_TOOLS
256#if !__TBB_TASK_PRIORITY
260#if __TBB_TASK_GROUP_CONTEXT
267 template<
typename R,
typename F>
272 return d.consume_result();
286#if __TBB_NUMA_SUPPORT
288 task_arena(
const constraints& constraints_,
unsigned reserved_for_masters = 1)
323 inline void initialize(
int max_concurrency_,
unsigned reserved_for_masters = 1) {
333#if __TBB_NUMA_SUPPORT
334 inline void initialize(constraints constraints_,
unsigned reserved_for_masters = 1) {
338 my_numa_id = constraints_.numa_id;
379#if __TBB_CPP11_RVALUE_REF_PRESENT
391#if __TBB_TASK_PRIORITY
395#if __TBB_CPP11_RVALUE_REF_PRESENT
397#if __TBB_PREVIEW_CRITICAL_TASKS
407#if __TBB_PREVIEW_CRITICAL_TASKS
440 void debug_wait_until_empty() {
459namespace this_task_arena {
460#if __TBB_TASK_ISOLATION
478using interface7::task_arena;
480namespace this_task_arena {
481 using namespace interface7::this_task_arena;
496#if __TBB_TASK_PRIORITY
504 arena.internal_enqueue(t,
p);
509#undef __TBB_task_arena_H_include_area
#define __TBB_EXPORTED_METHOD
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
#define __TBB_FORWARDING_REF(A)
#define __TBB_TASK_PRIORITY
#define __TBB_TASK_GROUP_CONTEXT
#define __TBB_EXPORTED_FUNC
void const char const char int ITT_FORMAT __itt_group_sync s
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d
void const char const char int ITT_FORMAT __itt_group_sync p
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
void move(tbb_thread &t1, tbb_thread &t2)
Identifiers declared inside namespace internal should never be used directly by client code.
static const int priority_critical
atomic< T > & as_atomic(T &t)
void __TBB_EXPORTED_FUNC isolate_within_arena(delegate_base &d, intptr_t isolation=0)
int current_thread_index()
Returns the index, aka slot number, of the calling thread in its current arena.
int max_concurrency()
Returns the maximal number of threads that can work inside the arena.
internal::return_type_or_void< F >::type isolate(F &f)
Used to form groups of tasks.
Base class for user-defined tasks.
static void enqueue(task &t)
Enqueue task for starvation-resistant execution.
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
virtual void operator()() const =0
decltype(declval< F >()()) type
void operator()() const __TBB_override
tbb::aligned_space< R > my_return_storage
void operator()() const __TBB_override
void consume_result() const
static const int automatic
Typedef for number of threads that is automatic.
static const int not_initialized
void __TBB_EXPORTED_METHOD internal_wait() const
intptr_t my_version_and_traits
Special settings.
static int __TBB_EXPORTED_FUNC internal_max_concurrency(const task_arena *)
void __TBB_EXPORTED_METHOD internal_enqueue(task &, intptr_t) const
internal::arena * my_arena
NULL if not currently initialized.
task_group_context * my_context
default context of the arena
task_arena_base(int max_concurrency, unsigned reserved_for_masters)
void __TBB_EXPORTED_METHOD internal_attach()
unsigned my_master_slots
Reserved master slots.
void __TBB_EXPORTED_METHOD internal_execute(delegate_base &) const
int my_max_concurrency
Concurrency level for deferred initialization.
void __TBB_EXPORTED_METHOD internal_initialize()
static int __TBB_EXPORTED_FUNC internal_current_slot()
void __TBB_EXPORTED_METHOD internal_terminate()
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.
task_arena(const task_arena &s)
Copies settings from another task_arena.
task_arena(attach)
Creates an instance of task_arena attached to the current arena of the thread.
internal::return_type_or_void< F >::type execute(F &f)
void initialize()
Forces allocation of the resources for the task_arena as specified in constructor arguments.
void initialize(attach)
Attaches this instance to the current arena of the thread.
task_arena(int max_concurrency_=automatic, unsigned reserved_for_masters=1)
Creates task_arena with certain concurrency limits.
void enqueue_impl(__TBB_FORWARDING_REF(F) f, priority_t p=priority_t(0))
void initialize(int max_concurrency_, unsigned reserved_for_masters=1)
Overrides concurrency level and forces initialization of internal representation.
__TBB_DEPRECATED void enqueue(F &&f, priority_t p)
static int current_thread_index()
Tag class used to indicate the "attaching" constructor.
Base class for types that should not be assigned.