39 extern generic_scheduler* (*AllocateSchedulerPtr)( market& );
45 #if __TBB_TASK_GROUP_CONTEXT 46 context_state_propagation_mutex_type the_context_state_propagation_mutex;
48 uintptr_t the_context_state_propagation_epoch = 0;
59 #if __TBB_TASK_GROUP_CONTEXT 63 #if __TBB_TASK_PRIORITY 82 #if _MSC_VER && !defined(__INTEL_COMPILER) 85 #pragma warning(disable:4355) 92 , my_small_task_count(1)
94 , my_cilk_state(cs_none)
102 #if __TBB_TASK_PRIORITY 103 my_ref_top_priority = &m.my_global_top_priority;
104 my_ref_reload_epoch = &m.my_global_reload_epoch;
106 #if __TBB_TASK_GROUP_CONTEXT 108 my_context_state_propagation_epoch = the_context_state_propagation_epoch;
109 my_context_list_head.my_prev = &my_context_list_head;
110 my_context_list_head.my_next = &my_context_list_head;
111 ITT_SYNC_CREATE(&my_context_list_mutex, SyncType_Scheduler, SyncObj_ContextsList);
117 #if _MSC_VER && !defined(__INTEL_COMPILER) 119 #endif // warning 4355 is back 121 #if TBB_USE_ASSERT > 1 132 for (
size_t i = 0; i < H; ++i )
133 __TBB_ASSERT( tp[i] == poisoned_ptr,
"Task pool corrupted" );
134 for (
size_t i = H; i < T; ++i ) {
138 tp[i]->prefix().extra_state ==
es_task_proxy,
"task in the deque has invalid state" );
142 __TBB_ASSERT( tp[i] == poisoned_ptr,
"Task pool corrupted" );
153 #if defined(_MSC_VER)&&_MSC_VER<1400 && !_WIN64 155 __asm mov eax, fs:[0x18]
158 NT_TIB *pteb = (NT_TIB*)NtCurrentTeb();
160 __TBB_ASSERT( &pteb < pteb->StackBase && &pteb > pteb->StackLimit,
"invalid stack info in TEB" );
161 __TBB_ASSERT( stack_size >0,
"stack_size not initialized?" );
179 void *stack_base = &stack_size;
180 #if __linux__ && !__bg__ 184 size_t np_stack_size = 0;
185 void *stack_limit = NULL;
186 pthread_attr_t np_attr_stack;
187 if( 0 == pthread_getattr_np(pthread_self(), &np_attr_stack) ) {
188 if ( 0 == pthread_attr_getstack(&np_attr_stack, &stack_limit, &np_stack_size) ) {
190 pthread_attr_t attr_stack;
191 if ( 0 == pthread_attr_init(&attr_stack) ) {
192 if ( 0 == pthread_attr_getstacksize(&attr_stack, &stack_size) ) {
193 if ( np_stack_size < stack_size ) {
196 rsb_base = stack_limit;
197 stack_size = np_stack_size/2;
199 stack_limit = (
char*)stack_limit + stack_size;
205 pthread_attr_destroy(&attr_stack);
208 my_rsb_stealing_threshold = (uintptr_t)((
char*)rsb_base + stack_size/2);
211 stack_size = size_t((
char*)stack_base - (
char*)stack_limit);
213 pthread_attr_destroy(&np_attr_stack);
216 __TBB_ASSERT( stack_size>0,
"stack size must be positive" );
221 #if __TBB_TASK_GROUP_CONTEXT 227 void generic_scheduler::cleanup_local_context_list () {
229 bool wait_for_concurrent_destroyers_to_leave =
false;
230 uintptr_t local_count_snapshot = my_context_state_propagation_epoch;
231 my_local_ctx_list_update.store<
relaxed>(1);
239 if ( my_nonlocal_ctx_list_update.load<
relaxed>() || local_count_snapshot != the_context_state_propagation_epoch )
240 lock.acquire(my_context_list_mutex);
244 while ( node != &my_context_list_head ) {
251 wait_for_concurrent_destroyers_to_leave =
true;
254 my_local_ctx_list_update.store<
release>(0);
256 if ( wait_for_concurrent_destroyers_to_leave )
263 #if __TBB_TASK_GROUP_CONTEXT 264 cleanup_local_context_list();
268 #if __TBB_HOARD_NONLOCAL_TASKS 269 while(
task* t = my_nonlocal_free_list ) {
271 my_nonlocal_free_list =
p.next;
288 #if __TBB_COUNT_TASK_NODES 289 my_market->update_task_node_count( my_task_node_count );
303 #if __TBB_HOARD_NONLOCAL_TASKS 304 if( (t = my_nonlocal_free_list) ) {
307 my_nonlocal_free_list = t->
prefix().next;
317 __TBB_ASSERT( t,
"another thread emptied the my_return_list" );
323 #if __TBB_COUNT_TASK_NODES 324 ++my_task_node_count;
326 t->
prefix().origin =
this;
330 #if __TBB_PREFETCHING 333 #if __TBB_HOARD_NONLOCAL_TASKS 349 #if __TBB_COUNT_TASK_NODES 350 ++my_task_node_count;
352 t->
prefix().origin = NULL;
355 #if __TBB_TASK_GROUP_CONTEXT 378 task* old =
s.my_return_list;
384 if(
as_atomic(
s.my_return_list).compare_and_swap(&t, old )==old ) {
385 #if __TBB_PREFETCHING 402 if ( T + num_tasks <= my_arena_slot->my_task_pool_size )
420 for (
size_t i = H; i < T; ++i )
429 if ( new_size < 2 * my_arena_slot->my_task_pool_size )
435 for (
size_t i = H; i < T; ++i )
457 bool sync_prepare_done =
false;
473 else if( !sync_prepare_done ) {
476 sync_prepare_done =
true;
499 task** victim_task_pool;
500 bool sync_prepare_done =
false;
502 victim_task_pool = victim_arena_slot->
task_pool;
508 if( sync_prepare_done )
519 else if( !sync_prepare_done ) {
522 sync_prepare_done =
true;
526 #if __TBB_STEALING_ABORT_ON_CONTENTION 527 if(!backoff.bounded_pause()) {
543 "not really locked victim's task pool?" );
544 return victim_task_pool;
548 task** victim_task_pool )
const {
549 __TBB_ASSERT( victim_arena_slot,
"empty victim arena slot pointer" );
562 __TBB_ASSERT( ref_count>=0,
"attempt to spawn task whose parent has a ref_count<0" );
563 __TBB_ASSERT( ref_count!=0,
"attempt to spawn task whose parent has a ref_count==0 (forgot to set_ref_count?)" );
569 "backwards compatibility to TBB 2.0 tasks is broken" );
570 #if __TBB_TASK_ISOLATION 572 t->
prefix().isolation = isolation;
582 #if __TBB_TASK_PRIORITY 603 if ( &
first->prefix().next == &next ) {
635 bool end = &t->prefix().next == &next;
636 t_next = t->
prefix().next;
641 size_t num_tasks = tasks.
size();
657 for(
task* t=
first; ; t=t->prefix().next ) {
659 __TBB_ASSERT( !t->prefix().parent,
"not a root task, or already running" );
660 t->prefix().parent = &dummy;
661 if( &t->prefix().next==&next )
break;
662 #if __TBB_TASK_GROUP_CONTEXT 663 __TBB_ASSERT( t->prefix().context == t->prefix().next->prefix().context,
664 "all the root tasks in list must share the same context");
685 s->my_arena->enqueue_task(t, (intptr_t)prio,
s->my_random );
688 #if __TBB_TASK_PRIORITY 689 class auto_indicator :
no_copy {
690 volatile bool& my_indicator;
692 auto_indicator (
volatile bool& indicator ) : my_indicator(indicator) { my_indicator = true ;}
693 ~auto_indicator () { my_indicator =
false; }
701 #if __TBB_TASK_ISOLATION 703 bool tasks_omitted =
false;
704 while ( !t && T>H0 ) {
705 t =
get_task( --T, isolation, tasks_omitted );
706 if ( !tasks_omitted ) {
712 if ( t && tasks_omitted ) {
742 #if __TBB_TASK_ISOLATION 757 __TBB_ASSERT( my_offloaded_tasks,
"At least one task is expected to be already offloaded" );
764 auto_indicator indicator( my_pool_reshuffling_pending );
774 for (
size_t src = H0; src<T0; ++src ) {
778 intptr_t
p = priority( *t );
779 if (
p<*my_ref_top_priority ) {
780 offload_task( *t,
p );
796 #if __TBB_TASK_ISOLATION 807 task **link = &offloaded_tasks;
808 while (
task *t = *link ) {
809 task** next_ptr = &t->prefix().next_offloaded;
811 if ( priority(*t) >= top_priority ) {
812 tasks.push_back( t );
815 task* next = *next_ptr;
816 t->prefix().owner =
this;
824 if ( link == &offloaded_tasks ) {
825 offloaded_tasks = NULL;
827 offloaded_task_list_link = NULL;
834 offloaded_task_list_link = link;
837 size_t num_tasks = tasks.size();
850 if ( t ) --num_tasks;
858 uintptr_t reload_epoch = *my_ref_reload_epoch;
861 || my_local_reload_epoch - reload_epoch > uintptr_t(-1)/2,
862 "Reload epoch counter overflow?" );
863 if ( my_local_reload_epoch == reload_epoch )
866 intptr_t top_priority = effective_reference_priority();
868 task *t = reload_tasks( my_offloaded_tasks, my_offloaded_task_list_tail_link,
__TBB_ISOLATION_ARG( top_priority, isolation ) );
885 my_local_reload_epoch = reload_epoch;
890 #if __TBB_TASK_ISOLATION 897 || is_local_task_pool_quiescent(),
"Is it safe to get a task at position T?" );
899 task* result = my_arena_slot->task_pool_ptr[T];
900 __TBB_ASSERT( !is_poisoned( result ),
"The poisoned task is going to be processed" );
901 #if __TBB_TASK_ISOLATION 906 if ( !omit && !is_proxy( *result ) )
909 tasks_omitted =
true;
914 if ( !result || !is_proxy( *result ) )
918 task_proxy& tp = static_cast<task_proxy&>(*result);
922 __TBB_ASSERT( is_version_3_task( *t ),
"backwards compatibility with TBB 2.0 broken" );
924 my_innermost_running_task = t;
925 #if __TBB_TASK_ISOLATION 927 if ( !tasks_omitted )
931 t->note_affinity( my_affinity_id );
937 free_task<small_task>( tp );
938 #if __TBB_TASK_ISOLATION 940 my_arena_slot->task_pool_ptr[T] = NULL;
950 size_t H0 = (size_t)-1, T = T0;
952 bool task_pool_empty =
false;
961 if ( (intptr_t)H0 > (intptr_t)T ) {
965 && H0 == T + 1,
"victim/thief arbitration algorithm failure" );
968 task_pool_empty =
true;
970 }
else if ( H0 == T ) {
973 task_pool_empty =
true;
982 #if __TBB_TASK_ISOLATION 983 result =
get_task( T, isolation, tasks_omitted );
987 }
else if ( !tasks_omitted ) {
995 }
while ( !result && !task_pool_empty );
997 #if __TBB_TASK_ISOLATION 998 if ( tasks_omitted ) {
999 if ( task_pool_empty ) {
1046 task* result = NULL;
1049 bool tasks_omitted =
false;
1061 result = victim_pool[H-1];
1069 task_proxy& tp = *static_cast<task_proxy*>(result);
1077 tasks_omitted =
true;
1078 }
else if ( !tasks_omitted ) {
1084 }
while ( !result );
1088 ITT_NOTIFY( sync_acquired, (
void*)((uintptr_t)&victim_slot+
sizeof( uintptr_t )) );
1090 if ( tasks_omitted ) {
1092 victim_pool[H-1] = NULL;
1097 #if __TBB_PREFETCHING 1101 if ( tasks_omitted )
1116 free_task<no_cache_small_task>(*tp);
1123 __TBB_ASSERT ( my_arena_index < my_arena->my_num_slots,
"arena slot index is out-of-bound" );
1127 "entering arena without tasks to share" );
1149 s->my_arena_index = index;
1150 s->my_dummy_task->prefix().ref_count = 2;
1153 s->init_stack_info();
1164 task& t = *
s->my_dummy_task;
1166 t.
prefix().ref_count = 1;
1167 #if __TBB_TASK_GROUP_CONTEXT 1170 #if __TBB_FP_CONTEXT 1171 s->default_context()->capture_fp_settings();
1174 s->init_stack_info();
1175 context_state_propagation_mutex_type::scoped_lock
lock(the_context_state_propagation_mutex);
1176 s->my_market->my_masters.push_front( *
s );
1181 s->attach_arena( a, 0,
true );
1182 s->my_arena_slot->my_scheduler =
s;
1183 a->my_default_ctx =
s->default_context();
1185 __TBB_ASSERT(
s->my_arena_index == 0,
"Master thread must occupy the first slot in its arena" );
1189 s->my_market->register_master(
s->master_exec_resource );
1192 #if __TBB_ARENA_OBSERVER 1193 __TBB_ASSERT( !a || a->my_observers.empty(),
"Just created arena cannot have any observers associated with it" );
1195 #if __TBB_SCHEDULER_OBSERVER 1196 the_global_observer_list.notify_entry_observers(
s->my_last_global_observer,
false );
1203 __TBB_ASSERT( !
s.my_arena_slot,
"cleaning up attached worker" );
1204 #if __TBB_SCHEDULER_OBSERVER 1206 the_global_observer_list.notify_exit_observers(
s.my_last_global_observer,
true );
1232 #if __TBB_ARENA_OBSERVER 1234 a->my_observers.notify_exit_observers( my_last_local_observer,
false );
1236 #if __TBB_SCHEDULER_OBSERVER 1237 the_global_observer_list.notify_exit_observers( my_last_global_observer,
false );
1240 m->unregister_master( master_exec_resource );
1244 #if __TBB_STATISTICS 1249 #if __TBB_TASK_GROUP_CONTEXT 1251 default_context()->~task_group_context();
1254 context_state_propagation_mutex_type::scoped_lock
lock(the_context_state_propagation_mutex);
1264 return m->
release( a != NULL, blocking_terminate );
static generic_scheduler * create_worker(market &m, size_t index)
Initialize a scheduler for a worker thread.
#define __TBB_ISOLATION_ARG(arg1, isolation)
void allocate_task_pool(size_t n)
task object is freshly allocated or recycled.
const size_t task_prefix_reservation_size
Number of bytes reserved for a task prefix.
#define __TBB_control_consistency_helper()
void deallocate_task(task &t)
Return task object to the memory allocator.
uintptr_t my_stealing_threshold
Position in the call stack specifying its maximal filling when stealing is still allowed.
arena_slot * my_arena_slot
Pointer to the slot in the arena we own at the moment.
static const intptr_t mailbox_bit
generic_scheduler(market &)
void on_thread_leaving()
Notification that worker or master leaves its arena.
int my_num_workers_requested
The number of workers that are currently requested from the resource manager.
void poison_pointer(T *__TBB_atomic &)
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 * task
static void sign_on(generic_scheduler *s)
Register TBB scheduler instance in thread-local storage.
void spin_wait_until_eq(const volatile T &location, const U value)
Spin UNTIL the value of the variable is equal to a given value.
void fill_with_canary_pattern(size_t, size_t)
generic_scheduler *(* AllocateSchedulerPtr)(market &)
Pointer to the scheduler factory function.
Class that implements exponential backoff.
Base class for user-defined tasks.
void local_spawn(task *first, task *&next)
Work stealing task scheduler.
task & allocate_task(size_t number_of_bytes, __TBB_CONTEXT_ARG(task *parent, task_group_context *context))
Allocate task object, either from the heap or a free list.
bool recipient_is_idle()
True if thread that owns this mailbox is looking for work.
static const kind_type detached
static bool is_shared(intptr_t tat)
True if the proxy is stored both in its sender's pool and in the destination mailbox.
void __TBB_store_with_release(volatile T &location, V value)
atomic< T > & as_atomic(T &t)
generic_scheduler * allocate_scheduler(market &m)
void const char const char int ITT_FORMAT __itt_group_sync s
task * my_free_list
Free list of small tasks that can be reused.
#define __TBB_get_object_ref(class_name, member_name, member_addr)
Returns address of the object containing a member with the given name and address.
affinity_id my_affinity_id
The mailbox id assigned to this scheduler.
bool release(bool is_public, bool blocking_terminate)
Decrements market's refcount and destroys it in the end.
static const intptr_t num_priority_levels
task * get_task(__TBB_ISOLATION_EXPR(isolation_tag isolation))
Get a task from the local pool.
Memory prefix to a task object.
Base class for types that should not be copied or assigned.
void * __TBB_get_bsp()
Retrieves the current RSE backing store pointer. IA64 specific.
Smart holder for the empty task class with automatic destruction.
task * extract_task()
Returns a pointer to the encapsulated task or NULL, and frees proxy if necessary.
virtual void __TBB_EXPORTED_METHOD note_affinity(affinity_id id)
Invoked by scheduler to notify task that it ran on unexpected thread.
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 parent
__TBB_atomic intptr_t my_small_task_count
Number of small tasks that have been allocated by this scheduler.
void free_scheduler()
Destroy and deallocate this scheduler object.
A scheduler with a customized evaluation loop.
void spawn_root_and_wait(task &first, task *&next) __TBB_override
For internal use only.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
auto first(Container &c) -> decltype(begin(c))
task * prepare_for_spawning(task *t)
Checks if t is affinitized to another thread, and if so, bundles it as proxy.
void const char const char int ITT_FORMAT __itt_group_sync p
scheduler_properties my_properties
task_group_context * context()
This method is deprecated and will be removed in the future.
task * my_dummy_task
Fake root task created by slave threads.
void init_stack_info()
Sets up the data necessary for the stealing limiting heuristics.
static market & global_market(bool is_public, unsigned max_num_workers=0, size_t stack_size=0)
Factory method creating new market object.
void local_spawn_root_and_wait(task *first, task *&next)
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 sync_releasing
static const size_t min_task_pool_size
size_t my_task_pool_size
Capacity of the primary task pool (number of elements - pointers to task).
bool is_quiescent_local_task_pool_reset() const
static generic_scheduler * local_scheduler()
Obtain the thread-local instance of the TBB scheduler.
static const size_t quick_task_size
If sizeof(task) is <=quick_task_size, it is handled on a free list instead of malloc'd.
static const unsigned ref_external
Reference increment values for externals and workers.
void push(task_proxy *t)
Push task_proxy onto the mailbox queue of another thread.
#define ITT_NOTIFY(name, obj)
void commit_spawned_tasks(size_t new_tail)
Makes newly spawned tasks visible to thieves.
static const kind_type binding_required
size_t prepare_task_pool(size_t n)
Makes sure that the task pool can accommodate at least n more elements.
static bool is_set(generic_scheduler *s)
Used to check validity of the local scheduler TLS contents.
#define __TBB_cl_evict(p)
task is in ready pool, or is going to be put there, or was just taken off.
void pause()
Pause for a while.
void release_task_pool() const
Unlocks the local task pool.
Represents acquisition of a mutex.
task **__TBB_atomic task_pool
#define __TBB_cl_prefetch(p)
task ** lock_task_pool(arena_slot *victim_arena_slot) const
Locks victim's task pool, and returns pointer to it. The pointer can be NULL.
void copy_memory(T *dst) const
Copies the contents of the vector into the dst array.
__TBB_atomic size_t head
Index of the first ready task in the deque.
Used to form groups of tasks.
#define ITT_SYNC_CREATE(obj, type, name)
void spawn(task &first, task *&next) __TBB_override
For internal use only.
void free_nonlocal_small_task(task &t)
Free a small task t that that was allocated by a different scheduler.
static task * plugged_return_list()
Special value used to mark my_return_list as not taking any more entries.
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 sync_cancel
virtual ~scheduler()=0
Pure virtual destructor;.
intptr_t isolation_tag
A tag for task isolation.
T max(const T &val1, const T &val2)
Utility template function returning greater of the two values.
void push_back(const T &val)
#define __TBB_ISOLATION_EXPR(isolation)
task * parent() const
task on whose behalf this task is working, or NULL if this is a root.
void advertise_new_work()
If necessary, raise a flag that there is new job in arena.
void acquire_task_pool() const
Locks the local task pool.
task **__TBB_atomic task_pool_ptr
uintptr_t my_version_and_traits
Version for run-time checks and behavioral traits of the context.
atomic< unsigned > my_limit
The maximal number of currently busy slots.
void *__TBB_EXPORTED_FUNC NFS_Allocate(size_t n_element, size_t element_size, void *hint)
Allocate memory on cache/sector line boundary.
void __TBB_store_relaxed(volatile T &location, V value)
state_type state() const
Current execution state.
bool is_local_task_pool_quiescent() const
__TBB_atomic size_t tail
Index of the element following the last ready task in the deque.
task * steal_task(__TBB_ISOLATION_ARG(arena_slot &victim_arena_slot, isolation_tag isolation))
Steal task from another scheduler's ready pool.
void assert_task_valid(const task *)
mail_outbox * outbox
Mailbox to which this was mailed.
task * get_mailbox_task(__TBB_ISOLATION_EXPR(isolation_tag isolation))
Attempt to get a task from the mailbox.
static const intptr_t location_mask
void commit_relocated_tasks(size_t new_tail)
Makes relocated tasks visible to thieves and releases the local task pool.
#define __TBB_CONTEXT_ARG(arg1, context)
Set if ref_count might be changed by another thread. Used for debugging.
void Scheduler_OneTimeInitialization(bool itt_present)
Defined in scheduler.cpp.
market * my_market
The market I am in.
Set if the task has been stolen.
static void cleanup_worker(void *arg, bool worker)
Perform necessary cleanup when a worker thread finishes.
unsigned short affinity_id
An id as used for specifying affinity.
#define __TBB_FetchAndDecrementWrelease(P)
virtual void local_wait_for_all(task &parent, task *child)=0
__TBB_atomic reference_count ref_count
Reference count used for synchronization.
arena * my_arena
The arena that I own (if master) or am servicing at the moment (if worker)
task object is on free list, or is going to be put there, or was just taken off.
static void sign_off(generic_scheduler *s)
Unregister TBB scheduler instance from thread-local storage.
void atomic_fence()
Sequentially consistent full memory fence.
__TBB_atomic kind_type my_kind
Flavor of this context: bound or isolated.
mail_outbox & mailbox(affinity_id id)
Get reference to mailbox corresponding to given affinity_id.
void __TBB_EXPORTED_FUNC NFS_Free(void *)
Free memory allocated by NFS_Allocate.
bool outermost
Indicates that a scheduler is on outermost level.
void assert_task_pool_valid() const
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 end
static const kind_type dying
size_t worker_stack_size() const
Returns the requested stack size of worker threads.
T __TBB_load_relaxed(const volatile T &location)
void leave_task_pool()
Leave the task pool.
void publish_task_pool()
Used by workers to enter the task pool.
static bool is_proxy(const task &t)
True if t is a task_proxy.
bool cleanup_master(bool blocking_terminate)
Perform necessary cleanup when a master thread stops using TBB.
void unlock_task_pool(arena_slot *victim_arena_slot, task **victim_task_pool) const
Unlocks victim's task pool.
generic_scheduler * my_scheduler
Scheduler of the thread attached to the slot.
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 * lock
size_t my_arena_index
Index of the arena slot the scheduler occupies now, or occupied last time.
internal::task_prefix & prefix(internal::version_tag *=NULL) const
Get reference to corresponding task_prefix.
void reset_task_pool_and_leave()
Resets head and tail indices to 0, and leaves task pool.
bool is_quiescent_local_task_pool_empty() const
bool is_worker() const
True if running on a worker thread, false otherwise.
task_proxy * pop(__TBB_ISOLATION_EXPR(isolation_tag isolation))
Get next piece of mail, or NULL if mailbox is empty.
intptr_t reference_count
A reference count.
static bool is_version_3_task(task &t)
task * my_return_list
List of small tasks that have been returned to this scheduler by other schedulers.
const isolation_tag no_isolation
void enqueue(task &, void *reserved) __TBB_override
For internal use only.
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 new_size
Vector that grows without reallocations, and stores items in the reverse order.
static const intptr_t pool_bit
task * my_innermost_running_task
Innermost task whose task::execute() is running. A dummy task on the outermost level.
static generic_scheduler * create_master(arena *a)
Initialize a scheduler for a master thread.
context_list_node_t * my_next
#define GATHER_STATISTIC(x)
bool is_task_pool_published() const