task.h
Go to the documentation of this file.
/*
Copyright (c) 2005-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef __TBB_task_H
#define __TBB_task_H
#define __TBB_task_H_include_area
#include "internal/_warning_suppress_enable_notice.h"
#include "tbb_stddef.h"
#include "tbb_machine.h"
#include "tbb_profiling.h"
#include <climits>
typedef struct ___itt_caller *__itt_caller;
namespace tbb {
class task;
class task_list;
class task_group_context;
// MSVC does not allow taking the address of a member that was defined
// privately in task_base and made public in class task via a using declaration.
#if _MSC_VER || (__GNUC__==3 && __GNUC_MINOR__<3)
#define __TBB_TASK_BASE_ACCESS public
#else
#define __TBB_TASK_BASE_ACCESS private
#endif
namespace internal { //< @cond INTERNAL
class allocate_additional_child_of_proxy: no_assign {
task* self;
task& parent;
public:
explicit allocate_additional_child_of_proxy( task& parent_ ) : self(NULL), parent(parent_) {
suppress_unused_warning( self );
}
task& __TBB_EXPORTED_METHOD allocate( size_t size ) const;
void __TBB_EXPORTED_METHOD free( task& ) const;
};
struct cpu_ctl_env_space { int space[sizeof(internal::uint64_t)/sizeof(int)]; };
} //< namespace internal @endcond
namespace interface5 {
namespace internal {
class task_base: tbb::internal::no_copy {
__TBB_TASK_BASE_ACCESS:
friend class tbb::task;
static void spawn( task& t );
static void spawn( task_list& list );
static tbb::internal::allocate_additional_child_of_proxy allocate_additional_child_of( task& t ) {
return tbb::internal::allocate_additional_child_of_proxy(t);
}
static void __TBB_EXPORTED_FUNC destroy( task& victim );
};
} // internal
} // interface5
namespace internal {
class scheduler: no_copy {
public:
virtual void spawn( task& first, task*& next ) = 0;
virtual void wait_for_all( task& parent, task* child ) = 0;
virtual void spawn_root_and_wait( task& first, task*& next ) = 0;
// Have to have it just to shut up overzealous compilation warnings
virtual ~scheduler() = 0;
virtual void enqueue( task& t, void* reserved ) = 0;
};
typedef intptr_t reference_count;
#if __TBB_PREVIEW_RESUMABLE_TASKS
static const reference_count abandon_flag = reference_count(1) << (sizeof(reference_count)*CHAR_BIT - 2);
#endif
typedef unsigned short affinity_id;
#if __TBB_TASK_ISOLATION
typedef intptr_t isolation_tag;
const isolation_tag no_isolation = 0;
#endif /* __TBB_TASK_ISOLATION */
#if __TBB_TASK_GROUP_CONTEXT
class generic_scheduler;
struct context_list_node_t {
context_list_node_t *my_prev,
*my_next;
};
class allocate_root_with_context_proxy: no_assign {
task_group_context& my_context;
public:
allocate_root_with_context_proxy ( task_group_context& ctx ) : my_context(ctx) {}
task& __TBB_EXPORTED_METHOD allocate( size_t size ) const;
void __TBB_EXPORTED_METHOD free( task& ) const;
};
#endif /* __TBB_TASK_GROUP_CONTEXT */
class allocate_root_proxy: no_assign {
public:
static task& __TBB_EXPORTED_FUNC allocate( size_t size );
static void __TBB_EXPORTED_FUNC free( task& );
};
class allocate_continuation_proxy: no_assign {
public:
task& __TBB_EXPORTED_METHOD allocate( size_t size ) const;
void __TBB_EXPORTED_METHOD free( task& ) const;
};
class allocate_child_proxy: no_assign {
public:
task& __TBB_EXPORTED_METHOD allocate( size_t size ) const;
void __TBB_EXPORTED_METHOD free( task& ) const;
};
#if __TBB_PREVIEW_CRITICAL_TASKS
// TODO: move to class methods when critical task API becomes public
void make_critical( task& t );
bool is_critical( task& t );
#endif
class task_prefix {
private:
friend class tbb::task;
friend class tbb::interface5::internal::task_base;
friend class tbb::task_list;
friend class internal::scheduler;
friend class internal::allocate_root_proxy;
friend class internal::allocate_child_proxy;
friend class internal::allocate_continuation_proxy;
friend class internal::allocate_additional_child_of_proxy;
#if __TBB_PREVIEW_CRITICAL_TASKS
friend void make_critical( task& );
friend bool is_critical( task& );
#endif
#if __TBB_TASK_ISOLATION
isolation_tag isolation;
#else
intptr_t reserved_space_for_task_isolation_tag;
#endif /* __TBB_TASK_ISOLATION */
#if __TBB_TASK_GROUP_CONTEXT
task_group_context *context;
#endif /* __TBB_TASK_GROUP_CONTEXT */
scheduler* origin;
#if __TBB_TASK_PRIORITY || __TBB_PREVIEW_RESUMABLE_TASKS
union {
#endif /* __TBB_TASK_PRIORITY */
scheduler* owner;
#if __TBB_TASK_PRIORITY
task* next_offloaded;
#endif
#if __TBB_PREVIEW_RESUMABLE_TASKS
scheduler* abandoned_scheduler;
#endif
#if __TBB_TASK_PRIORITY || __TBB_PREVIEW_RESUMABLE_TASKS
};
#endif /* __TBB_TASK_PRIORITY || __TBB_PREVIEW_RESUMABLE_TASKS */
tbb::task* parent;
__TBB_atomic reference_count ref_count;
int depth;
unsigned char state;
unsigned char extra_state;
affinity_id affinity;
tbb::task* next;
tbb::task& task() {return *reinterpret_cast<tbb::task*>(this+1);}
};
} // namespace internal
#if __TBB_TASK_GROUP_CONTEXT
#if __TBB_TASK_PRIORITY
namespace internal {
static const int priority_stride_v4 = INT_MAX / 4;
#if __TBB_PREVIEW_CRITICAL_TASKS
// TODO: move into priority_t enum when critical tasks become public feature
static const int priority_critical = priority_stride_v4 * 3 + priority_stride_v4 / 3 * 2;
#endif
}
enum priority_t {
priority_normal = internal::priority_stride_v4 * 2,
priority_low = priority_normal - internal::priority_stride_v4,
priority_high = priority_normal + internal::priority_stride_v4
};
#endif /* __TBB_TASK_PRIORITY */
#if TBB_USE_CAPTURED_EXCEPTION
class tbb_exception;
#else
namespace internal {
class tbb_exception_ptr;
}
#endif /* !TBB_USE_CAPTURED_EXCEPTION */
class task_scheduler_init;
namespace interface7 { class task_arena; }
using interface7::task_arena;
class task_group_context : internal::no_copy {
private:
friend class internal::generic_scheduler;
friend class task_scheduler_init;
friend class task_arena;
#if TBB_USE_CAPTURED_EXCEPTION
typedef tbb_exception exception_container_type;
#else
typedef internal::tbb_exception_ptr exception_container_type;
#endif
enum version_traits_word_layout {
traits_offset = 16,
version_mask = 0xFFFF,
traits_mask = 0xFFFFul << traits_offset
};
public:
enum kind_type {
isolated,
bound
};
enum traits_type {
exact_exception = 0x0001ul << traits_offset,
#if __TBB_FP_CONTEXT
fp_settings = 0x0002ul << traits_offset,
#endif
concurrent_wait = 0x0004ul << traits_offset,
#if TBB_USE_CAPTURED_EXCEPTION
default_traits = 0
#else
default_traits = exact_exception
#endif /* !TBB_USE_CAPTURED_EXCEPTION */
};
private:
enum state {
may_have_children = 1,
// the following enumerations must be the last, new 2^x values must go above
next_state_value, low_unused_state_bit = (next_state_value-1)*2
};
union {
// TODO: describe asynchronous use, and whether any memory semantics are needed
__TBB_atomic kind_type my_kind;
uintptr_t _my_kind_aligner;
};
task_group_context *my_parent;
internal::context_list_node_t my_node;
__itt_caller itt_caller;
char _leading_padding[internal::NFS_MaxLineSize
- 2 * sizeof(uintptr_t)- sizeof(void*) - sizeof(internal::context_list_node_t)
- sizeof(__itt_caller)
#if __TBB_FP_CONTEXT
- sizeof(internal::cpu_ctl_env_space)
#endif
];
#if __TBB_FP_CONTEXT
internal::cpu_ctl_env_space my_cpu_ctl_env;
#endif
uintptr_t my_cancellation_requested;
uintptr_t my_version_and_traits;
exception_container_type *my_exception;
internal::generic_scheduler *my_owner;
uintptr_t my_state;
#if __TBB_TASK_PRIORITY
intptr_t my_priority;
#endif /* __TBB_TASK_PRIORITY */
internal::string_index my_name;
char _trailing_padding[internal::NFS_MaxLineSize - 2 * sizeof(uintptr_t) - 2 * sizeof(void*)
#if __TBB_TASK_PRIORITY
- sizeof(intptr_t)
#endif /* __TBB_TASK_PRIORITY */
- sizeof(internal::string_index)
];
public:
task_group_context ( kind_type relation_with_parent = bound,
uintptr_t t = default_traits )
: my_kind(relation_with_parent)
, my_version_and_traits(3 | t)
, my_name(internal::CUSTOM_CTX)
{
init();
}
// Custom constructor for instrumentation of tbb algorithm
task_group_context ( internal::string_index name )
: my_kind(bound)
, my_version_and_traits(3 | default_traits)
, my_name(name)
{
init();
}
// Do not introduce standalone unbind method since it will break state propagation assumptions
__TBB_EXPORTED_METHOD ~task_group_context ();
void __TBB_EXPORTED_METHOD reset ();
bool __TBB_EXPORTED_METHOD cancel_group_execution ();
bool __TBB_EXPORTED_METHOD is_group_execution_cancelled () const;
void __TBB_EXPORTED_METHOD register_pending_exception ();
#if __TBB_FP_CONTEXT
void __TBB_EXPORTED_METHOD capture_fp_settings ();
#endif
#if __TBB_TASK_PRIORITY
__TBB_DEPRECATED void set_priority ( priority_t );
__TBB_DEPRECATED priority_t priority () const;
#endif /* __TBB_TASK_PRIORITY */
uintptr_t traits() const { return my_version_and_traits & traits_mask; }
protected:
void __TBB_EXPORTED_METHOD init ();
private:
friend class task;
friend class internal::allocate_root_with_context_proxy;
static const kind_type binding_required = bound;
static const kind_type binding_completed = kind_type(bound+1);
static const kind_type detached = kind_type(binding_completed+1);
static const kind_type dying = kind_type(detached+1);
template <typename T>
void propagate_task_group_state ( T task_group_context::*mptr_state, task_group_context& src, T new_state );
void bind_to ( internal::generic_scheduler *local_sched );
void register_with ( internal::generic_scheduler *local_sched );
#if __TBB_FP_CONTEXT
// TODO: Consider adding #else stub in order to omit #if sections in other code
void copy_fp_settings( const task_group_context &src );
#endif /* __TBB_FP_CONTEXT */
}; // class task_group_context
#endif /* __TBB_TASK_GROUP_CONTEXT */
class task: __TBB_TASK_BASE_ACCESS interface5::internal::task_base {
void __TBB_EXPORTED_METHOD internal_set_ref_count( int count );
internal::reference_count __TBB_EXPORTED_METHOD internal_decrement_ref_count();
protected:
task() {prefix().extra_state=1;}
public:
virtual ~task() {}
virtual task* execute() = 0;
enum state_type {
executing,
reexecute,
ready,
allocated,
freed,
recycle
#if __TBB_RECYCLE_TO_ENQUEUE
,to_enqueue
#endif
#if __TBB_PREVIEW_RESUMABLE_TASKS
,to_resume
#endif
};
//------------------------------------------------------------------------
// Allocating tasks
//------------------------------------------------------------------------
static internal::allocate_root_proxy allocate_root() {
return internal::allocate_root_proxy();
}
#if __TBB_TASK_GROUP_CONTEXT
static internal::allocate_root_with_context_proxy allocate_root( task_group_context& ctx ) {
return internal::allocate_root_with_context_proxy(ctx);
}
#endif /* __TBB_TASK_GROUP_CONTEXT */
internal::allocate_continuation_proxy& allocate_continuation() {
return *reinterpret_cast<internal::allocate_continuation_proxy*>(this);
}
internal::allocate_child_proxy& allocate_child() {
return *reinterpret_cast<internal::allocate_child_proxy*>(this);
}
using task_base::allocate_additional_child_of;
#if __TBB_DEPRECATED_TASK_INTERFACE
void __TBB_EXPORTED_METHOD destroy( task& t );
#else /* !__TBB_DEPRECATED_TASK_INTERFACE */
using task_base::destroy;
#endif /* !__TBB_DEPRECATED_TASK_INTERFACE */
//------------------------------------------------------------------------
// Recycling of tasks
//------------------------------------------------------------------------
void recycle_as_continuation() {
__TBB_ASSERT( prefix().state==executing, "execute not running?" );
prefix().state = allocated;
}
void recycle_as_safe_continuation() {
__TBB_ASSERT( prefix().state==executing, "execute not running?" );
prefix().state = recycle;
}
void recycle_as_child_of( task& new_parent ) {
internal::task_prefix& p = prefix();
__TBB_ASSERT( prefix().state==executing||prefix().state==allocated, "execute not running, or already recycled" );
__TBB_ASSERT( prefix().ref_count==0, "no child tasks allowed when recycled as a child" );
__TBB_ASSERT( p.parent==NULL, "parent must be null" );
__TBB_ASSERT( new_parent.prefix().state<=recycle, "corrupt parent's state" );
__TBB_ASSERT( new_parent.prefix().state!=freed, "parent already freed" );
p.state = allocated;
p.parent = &new_parent;
#if __TBB_TASK_GROUP_CONTEXT
p.context = new_parent.prefix().context;
#endif /* __TBB_TASK_GROUP_CONTEXT */
}
void recycle_to_reexecute() {
__TBB_ASSERT( prefix().state==executing, "execute not running, or already recycled" );
__TBB_ASSERT( prefix().ref_count==0, "no child tasks allowed when recycled for reexecution" );
prefix().state = reexecute;
}
#if __TBB_RECYCLE_TO_ENQUEUE
void recycle_to_enqueue() {
__TBB_ASSERT( prefix().state==executing, "execute not running, or already recycled" );
prefix().state = to_enqueue;
}
#endif /* __TBB_RECYCLE_TO_ENQUEUE */
//------------------------------------------------------------------------
// Spawning and blocking
//------------------------------------------------------------------------
void set_ref_count( int count ) {
#if TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT
internal_set_ref_count(count);
#else
prefix().ref_count = count;
#endif /* TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT */
}
void increment_ref_count() {
__TBB_FetchAndIncrementWacquire( &prefix().ref_count );
}
int add_ref_count( int count ) {
internal::call_itt_notify( internal::releasing, &prefix().ref_count );
internal::reference_count k = count+__TBB_FetchAndAddW( &prefix().ref_count, count );
__TBB_ASSERT( k>=0, "task's reference count underflowed" );
if( k==0 )
internal::call_itt_notify( internal::acquired, &prefix().ref_count );
return int(k);
}
int decrement_ref_count() {
#if TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT
return int(internal_decrement_ref_count());
#else
return int(__TBB_FetchAndDecrementWrelease( &prefix().ref_count ))-1;
#endif /* TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT */
}
using task_base::spawn;
void spawn_and_wait_for_all( task& child ) {
prefix().owner->wait_for_all( *this, &child );
}
void __TBB_EXPORTED_METHOD spawn_and_wait_for_all( task_list& list );
static void spawn_root_and_wait( task& root ) {
root.prefix().owner->spawn_root_and_wait( root, root.prefix().next );
}
static void spawn_root_and_wait( task_list& root_list );
void wait_for_all() {
prefix().owner->wait_for_all( *this, NULL );
}
#if __TBB_TASK_PRIORITY
#endif /* __TBB_TASK_PRIORITY */
static void enqueue( task& t ) {
t.prefix().owner->enqueue( t, NULL );
}
#if __TBB_TASK_PRIORITY
__TBB_DEPRECATED static void enqueue( task& t, priority_t p ) {
#if __TBB_PREVIEW_CRITICAL_TASKS
__TBB_ASSERT(p == priority_low || p == priority_normal || p == priority_high
|| p == internal::priority_critical, "Invalid priority level value");
#else
__TBB_ASSERT(p == priority_low || p == priority_normal || p == priority_high, "Invalid priority level value");
#endif
t.prefix().owner->enqueue( t, (void*)p );
}
#endif /* __TBB_TASK_PRIORITY */
#if __TBB_TASK_PRIORITY
__TBB_DEPRECATED inline static void enqueue( task& t, task_arena& arena, priority_t p = priority_t(0) );
#else
inline static void enqueue( task& t, task_arena& arena);
#endif
static task& __TBB_EXPORTED_FUNC self();
task* parent() const {return prefix().parent;}
void set_parent(task* p) {
#if __TBB_TASK_GROUP_CONTEXT
__TBB_ASSERT(!p || prefix().context == p->prefix().context, "The tasks must be in the same context");
#endif
prefix().parent = p;
}
#if __TBB_TASK_GROUP_CONTEXT
task_group_context* context() {return prefix().context;}
task_group_context* group () { return prefix().context; }
#endif /* __TBB_TASK_GROUP_CONTEXT */
bool is_stolen_task() const {
return (prefix().extra_state & 0x80)!=0;
}
bool is_enqueued_task() const {
// es_task_enqueued = 0x10
return (prefix().extra_state & 0x10)!=0;
}
#if __TBB_PREVIEW_RESUMABLE_TASKS
typedef void* suspend_point;
template <typename F>
static void suspend(F f);
static void resume(suspend_point tag);
#endif
//------------------------------------------------------------------------
// Debugging
//------------------------------------------------------------------------
state_type state() const {return state_type(prefix().state);}
int ref_count() const {
#if TBB_USE_ASSERT
#if __TBB_PREVIEW_RESUMABLE_TASKS
internal::reference_count ref_count_ = prefix().ref_count & ~internal::abandon_flag;
#else
internal::reference_count ref_count_ = prefix().ref_count;
#endif
__TBB_ASSERT( ref_count_==int(ref_count_), "integer overflow error");
#endif
#if __TBB_PREVIEW_RESUMABLE_TASKS
return int(prefix().ref_count & ~internal::abandon_flag);
#else
return int(prefix().ref_count);
#endif
}
bool __TBB_EXPORTED_METHOD is_owned_by_current_thread() const;
//------------------------------------------------------------------------
// Affinity
//------------------------------------------------------------------------
typedef internal::affinity_id affinity_id;
void set_affinity( affinity_id id ) {prefix().affinity = id;}
affinity_id affinity() const {return prefix().affinity;}
virtual void __TBB_EXPORTED_METHOD note_affinity( affinity_id id );
#if __TBB_TASK_GROUP_CONTEXT
void __TBB_EXPORTED_METHOD change_group ( task_group_context& ctx );
bool cancel_group_execution () { return prefix().context->cancel_group_execution(); }
bool is_cancelled () const { return prefix().context->is_group_execution_cancelled(); }
#else
bool is_cancelled () const { return false; }
#endif /* __TBB_TASK_GROUP_CONTEXT */
#if __TBB_TASK_PRIORITY
__TBB_DEPRECATED void set_group_priority ( priority_t p ) { prefix().context->set_priority(p); }
__TBB_DEPRECATED priority_t group_priority () const { return prefix().context->priority(); }
#endif /* __TBB_TASK_PRIORITY */
private:
friend class interface5::internal::task_base;
friend class task_list;
friend class internal::scheduler;
friend class internal::allocate_root_proxy;
#if __TBB_TASK_GROUP_CONTEXT
friend class internal::allocate_root_with_context_proxy;
#endif /* __TBB_TASK_GROUP_CONTEXT */
friend class internal::allocate_continuation_proxy;
friend class internal::allocate_child_proxy;
friend class internal::allocate_additional_child_of_proxy;
internal::task_prefix& prefix( internal::version_tag* = NULL ) const {
return reinterpret_cast<internal::task_prefix*>(const_cast<task*>(this))[-1];
}
#if __TBB_PREVIEW_CRITICAL_TASKS
friend void internal::make_critical( task& );
friend bool internal::is_critical( task& );
#endif
}; // class task
#if __TBB_PREVIEW_CRITICAL_TASKS
namespace internal {
inline void make_critical( task& t ) { t.prefix().extra_state |= 0x8; }
inline bool is_critical( task& t ) { return bool((t.prefix().extra_state & 0x8) != 0); }
} // namespace internal
#endif /* __TBB_PREVIEW_CRITICAL_TASKS */
#if __TBB_PREVIEW_RESUMABLE_TASKS
namespace internal {
template <typename F>
static void suspend_callback(void* user_callback, task::suspend_point tag) {
// Copy user function to a new stack to avoid a race when the previous scheduler is resumed.
F user_callback_copy = *static_cast<F*>(user_callback);
user_callback_copy(tag);
}
void __TBB_EXPORTED_FUNC internal_suspend(void* suspend_callback, void* user_callback);
void __TBB_EXPORTED_FUNC internal_resume(task::suspend_point);
task::suspend_point __TBB_EXPORTED_FUNC internal_current_suspend_point();
}
template <typename F>
inline void task::suspend(F f) {
internal::internal_suspend((void*)internal::suspend_callback<F>, &f);
}
inline void task::resume(suspend_point tag) {
internal::internal_resume(tag);
}
#endif
class empty_task: public task {
task* execute() __TBB_override {
return NULL;
}
};
namespace internal {
template<typename F>
class function_task : public task {
#if __TBB_ALLOW_MUTABLE_FUNCTORS
// TODO: deprecated behavior, remove
F my_func;
#else
const F my_func;
#endif
task* execute() __TBB_override {
my_func();
return NULL;
}
public:
function_task( const F& f ) : my_func(f) {}
#if __TBB_CPP11_RVALUE_REF_PRESENT
function_task( F&& f ) : my_func( std::move(f) ) {}
#endif
};
} // namespace internal
class task_list: internal::no_copy {
private:
task* first;
task** next_ptr;
friend class task;
friend class interface5::internal::task_base;
public:
task_list() : first(NULL), next_ptr(&first) {}
~task_list() {}
bool empty() const {return !first;}
void push_back( task& task ) {
task.prefix().next = NULL;
*next_ptr = &task;
next_ptr = &task.prefix().next;
}
#if __TBB_TODO
// TODO: add this method and implement&document the local execution ordering. See more in generic_scheduler::local_spawn
void push_front( task& task ) {
if( empty() ) {
push_back(task);
} else {
task.prefix().next = first;
first = &task;
}
}
#endif
task& pop_front() {
__TBB_ASSERT( !empty(), "attempt to pop item from empty task_list" );
task* result = first;
first = result->prefix().next;
if( !first ) next_ptr = &first;
return *result;
}
void clear() {
first=NULL;
next_ptr=&first;
}
};
inline void interface5::internal::task_base::spawn( task& t ) {
t.prefix().owner->spawn( t, t.prefix().next );
}
inline void interface5::internal::task_base::spawn( task_list& list ) {
if( task* t = list.first ) {
t->prefix().owner->spawn( *t, *list.next_ptr );
list.clear();
}
}
inline void task::spawn_root_and_wait( task_list& root_list ) {
if( task* t = root_list.first ) {
t->prefix().owner->spawn_root_and_wait( *t, *root_list.next_ptr );
root_list.clear();
}
}
} // namespace tbb
inline void *operator new( size_t bytes, const tbb::internal::allocate_root_proxy& ) {
return &tbb::internal::allocate_root_proxy::allocate(bytes);
}
inline void operator delete( void* task, const tbb::internal::allocate_root_proxy& ) {
tbb::internal::allocate_root_proxy::free( *static_cast<tbb::task*>(task) );
}
#if __TBB_TASK_GROUP_CONTEXT
inline void *operator new( size_t bytes, const tbb::internal::allocate_root_with_context_proxy& p ) {
return &p.allocate(bytes);
}
inline void operator delete( void* task, const tbb::internal::allocate_root_with_context_proxy& p ) {
p.free( *static_cast<tbb::task*>(task) );
}
#endif /* __TBB_TASK_GROUP_CONTEXT */
inline void *operator new( size_t bytes, const tbb::internal::allocate_continuation_proxy& p ) {
return &p.allocate(bytes);
}
inline void operator delete( void* task, const tbb::internal::allocate_continuation_proxy& p ) {
p.free( *static_cast<tbb::task*>(task) );
}
inline void *operator new( size_t bytes, const tbb::internal::allocate_child_proxy& p ) {
return &p.allocate(bytes);
}
inline void operator delete( void* task, const tbb::internal::allocate_child_proxy& p ) {
p.free( *static_cast<tbb::task*>(task) );
}
inline void *operator new( size_t bytes, const tbb::internal::allocate_additional_child_of_proxy& p ) {
return &p.allocate(bytes);
}
inline void operator delete( void* task, const tbb::internal::allocate_additional_child_of_proxy& p ) {
p.free( *static_cast<tbb::task*>(task) );
}
#include "internal/_warning_suppress_disable_notice.h"
#undef __TBB_task_H_include_area
#endif /* __TBB_task_H */
tbb::task::set_parent
void set_parent(task *p)
sets parent task pointer to specified value
Definition: task.h:857
tbb::task_group_context::traits_offset
Definition: task.h:360
tbb::task::prefix
internal::task_prefix & prefix(internal::version_tag *=NULL) const
Get reference to corresponding task_prefix.
Definition: task.h:991
tbb::task_group_context::_my_kind_aligner
uintptr_t _my_kind_aligner
Definition: task.h:395
__TBB_DEPRECATED
#define __TBB_DEPRECATED
Definition: tbb_config.h:637
tbb::task_group_context::_trailing_padding
char _trailing_padding[internal::NFS_MaxLineSize - 2 *sizeof(uintptr_t) - 2 *sizeof(void *) - sizeof(intptr_t) - sizeof(internal::string_index)]
Trailing padding protecting accesses to frequently used members from false sharing.
Definition: task.h:461
tbb::task::reexecute
task to be rescheduled.
Definition: task.h:628
tbb::task_list::first
task * first
Definition: task.h:1065
tbb::internal::task_prefix::depth
int depth
Obsolete. Used to be scheduling depth before TBB 2.2.
Definition: task.h:268
tbb::task::recycle
task to be recycled as continuation
Definition: task.h:636
tbb::task::set_ref_count
void set_ref_count(int count)
Set reference count.
Definition: task.h:750
tbb::task_list::task
friend class task
Definition: task.h:1067
tbb::internal::version_tag_v3
Definition: tbb_stddef.h:405
tbb::tbb_exception
Interface to be implemented by all exceptions TBB recognizes and propagates across the threads.
Definition: tbb_exception.h:137
internal
Definition: _flow_graph_async_msg_impl.h:24
tbb::task_group_context::copy_fp_settings
void copy_fp_settings(const task_group_context &src)
Copies FPU control setting from another context.
tbb::task_group_context::my_kind
__TBB_atomic kind_type my_kind
Flavor of this context: bound or isolated.
Definition: task.h:394
tbb::task_group_context::detached
static const kind_type detached
Definition: task.h:580
tbb::task::note_affinity
virtual void __TBB_EXPORTED_METHOD note_affinity(affinity_id id)
Invoked by scheduler to notify task that it ran on unexpected thread.
Definition: task.cpp:245
tbb::task::state_type
state_type
Enumeration of task states that the scheduler considers.
Definition: task.h:624
tbb::task_group_context::version_traits_word_layout
version_traits_word_layout
Definition: task.h:359
tbb::internal::allocate_root_with_context_proxy::allocate_root_with_context_proxy
allocate_root_with_context_proxy(task_group_context &ctx)
Definition: task.h:147
tbb::task::~task
virtual ~task()
Destructor.
Definition: task.h:618
tbb::internal::allocate_child_proxy::free
void __TBB_EXPORTED_METHOD free(task &) const
Definition: task.cpp:121
tbb::internal::task_prefix::next_offloaded
task * next_offloaded
Pointer to the next offloaded lower priority task.
Definition: task.h:241
tbb::task::affinity
affinity_id affinity() const
Current affinity of this task.
Definition: task.h:935
tbb::task::wait_for_all
void wait_for_all()
Wait for reference count to become one, and set reference count to zero.
Definition: task.h:808
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
id
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 id
Definition: ittnotify_static.h:172
tbb::task_group_context::bound
Definition: task.h:368
tbb::internal::no_copy
Base class for types that should not be copied or assigned.
Definition: tbb_stddef.h:330
tbb::internal::allocate_additional_child_of_proxy::parent
task & parent
Definition: task.h:49
tbb::internal::cpu_ctl_env_space::space
int space[sizeof(internal::uint64_t)/sizeof(int)]
Definition: task.h:58
count
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 count
Definition: ittnotify_static.h:145
tbb::internal::allocate_child_proxy
Definition: task.h:165
tbb::task::internal_decrement_ref_count
internal::reference_count __TBB_EXPORTED_METHOD internal_decrement_ref_count()
Decrement reference count and return its new value.
Definition: task.cpp:192
tbb::task_list
A list of children.
Definition: task.h:1063
tbb::task_scheduler_init
Class delimiting the scope of task scheduler activity.
Definition: task_scheduler_init.h:66
tbb::internal::allocate_root_with_context_proxy
Definition: task.h:144
tbb::task_group_context::exception_container_type
internal::tbb_exception_ptr exception_container_type
Definition: task.h:356
tbb::task_list::push_back
void push_back(task &task)
Push task onto back of list.
Definition: task.h:1080
tbb::internal::priority_critical
static const int priority_critical
Definition: task.h:302
tbb::task_group_context::kind_type
kind_type
Definition: task.h:366
tbb::internal::function_task::function_task
function_task(const F &f)
Definition: task.h:1052
tbb::task_group_context::concurrent_wait
Definition: task.h:376
tbb::task::allocate_child
internal::allocate_child_proxy & allocate_child()
Returns proxy for overloaded new that allocates a child task of *this.
Definition: task.h:670
tbb::internal::allocate_root_with_context_proxy::my_context
task_group_context & my_context
Definition: task.h:145
tbb::task_group_context::priority
__TBB_DEPRECATED priority_t priority() const
Retrieves current priority of the current task group.
tbb::internal::allocate_root_with_context_proxy::free
void __TBB_EXPORTED_METHOD free(task &) const
tbb::internal::task_prefix::is_critical
friend bool is_critical(task &)
Definition: task.h:1003
tbb
The graph class.
Definition: serial/tbb/parallel_for.h:46
tbb::internal::allocate_root_with_context_proxy::allocate
task &__TBB_EXPORTED_METHOD allocate(size_t size) const
tbb::task_list::next_ptr
task ** next_ptr
Definition: task.h:1066
tbb::task_group_context::my_cancellation_requested
uintptr_t my_cancellation_requested
Specifies whether cancellation was requested for this task group.
Definition: task.h:429
tbb::task_list::pop_front
task & pop_front()
Pop the front task from the list.
Definition: task.h:1098
tbb::empty_task
task that does nothing. Useful for synchronization.
Definition: task.h:1031
tbb::priority_normal
Definition: task.h:307
tbb::task::recycle_as_safe_continuation
void recycle_as_safe_continuation()
Recommended to use, safe variant of recycle_as_continuation.
Definition: task.h:708
tbb::internal::scheduler
Definition: task.h:99
tbb::task::group
task_group_context * group()
Pointer to the task group descriptor.
Definition: task.h:870
tbb::task::add_ref_count
int add_ref_count(int count)
Atomically adds to reference count and returns its new value.
Definition: task.h:766
tbb::task_group_context
Used to form groups of tasks.
Definition: task.h:347
tbb::internal::allocate_additional_child_of_proxy::self
task * self
No longer used, but retained for binary layout compatibility. Always NULL.
Definition: task.h:48
tbb::internal::function_task::execute
task * execute() __TBB_override
Should be overridden by derived classes.
Definition: task.h:1047
tbb::internal::allocate_additional_child_of_proxy
Definition: task.h:46
tbb::task_group_context::cancel_group_execution
bool __TBB_EXPORTED_METHOD cancel_group_execution()
Initiates cancellation of all tasks in this cancellation group and its subordinate groups.
tbb::task_group_context::isolated
Definition: task.h:367
tbb::task_group_context::default_traits
Definition: task.h:380
tbb::task::decrement_ref_count
int decrement_ref_count()
Atomically decrement reference count and returns its new value.
Definition: task.h:777
tbb::task::spawn_and_wait_for_all
void spawn_and_wait_for_all(task &child)
Similar to spawn followed by wait_for_all, but more efficient.
Definition: task.h:789
tbb::task_group_context::~task_group_context
__TBB_EXPORTED_METHOD ~task_group_context()
tbb::task_group_context::version_mask
Definition: task.h:361
size
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 size
Definition: ittnotify_static.h:109
__TBB_TASK_BASE_ACCESS
#define __TBB_TASK_BASE_ACCESS
Definition: task.h:41
tbb::internal::scheduler::~scheduler
virtual ~scheduler()=0
Pure virtual destructor;.
Definition: scheduler.cpp:72
tbb::internal::function_task::my_func
const F my_func
Definition: task.h:1045
tbb::task_group_context::propagate_task_group_state
void propagate_task_group_state(T task_group_context::*mptr_state, task_group_context &src, T new_state)
Propagates any state change detected to *this, and as an optimisation possibly also upward along the ...
tbb_profiling.h
tbb::task_group_context::fp_settings
Definition: task.h:374
tbb::internal::priority_stride_v4
static const int priority_stride_v4
Definition: task.h:299
tbb::interface5::internal::task_base::allocate_additional_child_of
static tbb::internal::allocate_additional_child_of_proxy allocate_additional_child_of(task &t)
Like allocate_child, except that task's parent becomes "t", not this.
Definition: task.h:82
tbb::task_group_context::state
state
Definition: task.h:385
tbb::internal::allocate_root_proxy::allocate
static task &__TBB_EXPORTED_FUNC allocate(size_t size)
Definition: task.cpp:35
tbb::task::increment_ref_count
void increment_ref_count()
Atomically increment reference count.
Definition: task.h:760
tbb::task::executing
task is running, and will be destroyed after method execute() completes.
Definition: task.h:626
tbb::task::recycle_as_continuation
void recycle_as_continuation()
Change this to be a continuation of its former self.
Definition: task.h:700
__TBB_atomic
#define __TBB_atomic
Definition: tbb_stddef.h:237
tbb::task::recycle_to_reexecute
void recycle_to_reexecute()
Schedule this for reexecution after current execute() returns.
Definition: task.h:730
tbb::task::is_owned_by_current_thread
bool __TBB_EXPORTED_METHOD is_owned_by_current_thread() const
Obsolete, and only retained for the sake of backward compatibility. Always returns true.
Definition: task.cpp:208
tbb::task::task
task()
Default constructor.
Definition: task.h:614
tbb::internal::task_prefix::parent
tbb::task * parent
The task whose reference count includes me.
Definition: task.h:256
tbb::task::internal_set_ref_count
void __TBB_EXPORTED_METHOD internal_set_ref_count(int count)
Set reference count.
Definition: task.cpp:183
tbb::internal::allocate_continuation_proxy::allocate
task &__TBB_EXPORTED_METHOD allocate(size_t size) const
Definition: task.cpp:96
tbb::internal::task_prefix::make_critical
friend void make_critical(task &)
Definition: task.h:1002
tbb::internal::allocate_continuation_proxy
Definition: task.h:159
tbb::priority_t
priority_t
Definition: task.h:306
tbb::task_group_context::bind_to
void bind_to(internal::generic_scheduler *local_sched)
Registers this context with the local scheduler and binds it to its parent context.
tbb::internal::task_prefix::ref_count
__TBB_atomic reference_count ref_count
Reference count used for synchronization.
Definition: task.h:263
tbb::internal::acquired
Definition: tbb_profiling.h:129
tbb::internal::allocate_child_proxy::allocate
task &__TBB_EXPORTED_METHOD allocate(size_t size) const
Definition: task.cpp:114
tbb::internal::is_critical
bool is_critical(task &t)
Definition: task.h:1003
tbb::task_group_context::_leading_padding
char _leading_padding[internal::NFS_MaxLineSize - 2 *sizeof(uintptr_t) - sizeof(void *) - sizeof(internal::context_list_node_t) - sizeof(__itt_caller) - sizeof(internal::cpu_ctl_env_space)]
Leading padding protecting accesses to frequently used members from false sharing.
Definition: task.h:419
tbb::internal::scheduler::wait_for_all
virtual void wait_for_all(task &parent, task *child)=0
For internal use only.
__TBB_FetchAndDecrementWrelease
#define __TBB_FetchAndDecrementWrelease(P)
Definition: tbb_machine.h:314
tbb::task_group_context::reset
void __TBB_EXPORTED_METHOD reset()
Forcefully reinitializes the context after the task tree it was associated with is completed.
tbb::internal::allocate_additional_child_of_proxy::free
void __TBB_EXPORTED_METHOD free(task &) const
Definition: task.cpp:134
tbb::internal::affinity_id
unsigned short affinity_id
An id as used for specifying affinity.
Definition: task.h:128
int
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 size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark d int
Definition: ittnotify_static.h:217
tbb::move
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:319
tbb::task_group_context::register_pending_exception
void __TBB_EXPORTED_METHOD register_pending_exception()
Records the pending exception, and cancels the task group.
tbb::internal::allocate_continuation_proxy::free
void __TBB_EXPORTED_METHOD free(task &) const
Definition: task.cpp:105
tbb::interface5::internal::task_base
Base class for methods that became static in TBB 3.0.
Definition: task.h:69
tbb::task::is_stolen_task
bool is_stolen_task() const
True if task was stolen from the task pool of another thread.
Definition: task.h:874
tbb::task_group_context::traits_mask
Definition: task.h:362
tbb::internal::scheduler::spawn_root_and_wait
virtual void spawn_root_and_wait(task &first, task *&next)=0
For internal use only.
tbb::internal::no_isolation
const isolation_tag no_isolation
Definition: task.h:133
tbb::internal::task_prefix
Memory prefix to a task object.
Definition: task.h:192
tbb::task_group_context::task_group_context
task_group_context(internal::string_index name)
Definition: task.h:503
tbb::internal::task_prefix::affinity
affinity_id affinity
Definition: task.h:283
tbb::task_group_context::binding_completed
static const kind_type binding_completed
Definition: task.h:579
tbb::internal::allocate_root_proxy
Definition: task.h:153
tbb::task::freed
task object is on free list, or is going to be put there, or was just taken off.
Definition: task.h:634
tbb::task_group_context::my_state
uintptr_t my_state
Internal state (combination of state flags, currently only may_have_children).
Definition: task.h:444
tbb::task::enqueue
static void enqueue(task &t)
Enqueue task for starvation-resistant execution.
Definition: task.h:825
tbb::task::group_priority
__TBB_DEPRECATED priority_t group_priority() const
Retrieves current priority of the task group this task belongs to.
Definition: task.h:973
tbb::task_group_context::is_group_execution_cancelled
bool __TBB_EXPORTED_METHOD is_group_execution_cancelled() const
Returns true if the context received cancellation request.
tbb::task::affinity_id
internal::affinity_id affinity_id
An id as used for specifying affinity.
Definition: task.h:929
tbb::internal::allocate_additional_child_of_proxy::allocate
task &__TBB_EXPORTED_METHOD allocate(size_t size) const
Definition: task.cpp:128
tbb::task::state
state_type state() const
Current execution state.
Definition: task.h:901
tbb::internal::NFS_MaxLineSize
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
Definition: tbb_stddef.h:216
tbb::task::recycle_as_child_of
void recycle_as_child_of(task &new_parent)
Change this to be a child of new_parent.
Definition: task.h:714
tbb::task::is_enqueued_task
bool is_enqueued_task() const
True if the task was enqueued.
Definition: task.h:879
tbb::task_group_context::my_node
internal::context_list_node_t my_node
Used to form the thread specific list of contexts without additional memory allocation.
Definition: task.h:404
parent
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
Definition: ittnotify_static.h:176
tbb::priority_low
Definition: task.h:308
tbb::task_group_context::capture_fp_settings
void __TBB_EXPORTED_METHOD capture_fp_settings()
Captures the current FPU control settings to the context.
tbb::task_group_context::my_version_and_traits
uintptr_t my_version_and_traits
Version for run-time checks and behavioral traits of the context.
Definition: task.h:435
tbb::task::ref_count
int ref_count() const
The internal reference count.
Definition: task.h:904
tbb::internal::context_list_node_t
Definition: task.h:139
tbb::task::execute
virtual task * execute()=0
Should be overridden by derived classes.
_warning_suppress_disable_notice.h
tbb::internal::isolation_tag
intptr_t isolation_tag
A tag for task isolation.
Definition: task.h:132
tbb::internal::first
auto first(Container &c) -> decltype(begin(c))
Definition: _range_iterator.h:34
tbb::task_group_context::exact_exception
Definition: task.h:372
__TBB_override
#define __TBB_override
Definition: tbb_stddef.h:240
tbb::task_group_context::dying
static const kind_type dying
Definition: task.h:581
tbb::internal::cpu_ctl_env_space
Definition: task.h:58
tbb::task::parent
task * parent() const
task on whose behalf this task is working, or NULL if this is a root.
Definition: task.h:854
tbb::internal::string_index
string_index
Definition: tbb_profiling.h:28
tbb::internal::task_prefix::task
tbb::task & task()
The task corresponding to this task_prefix.
Definition: task.h:289
tbb::internal::allocate_root_proxy::free
static void __TBB_EXPORTED_FUNC free(task &)
Definition: task.cpp:47
__TBB_EXPORTED_FUNC
#define __TBB_EXPORTED_FUNC
Definition: scalable_allocator.h:38
tbb::task::allocated
task object is freshly allocated or recycled.
Definition: task.h:632
tbb_machine.h
tbb::internal::suppress_unused_warning
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
Definition: tbb_stddef.h:398
tbb::interface5::internal::task_base::spawn
static void spawn(task &t)
Schedule task for execution when a worker becomes available.
Definition: task.h:1113
tbb::internal::no_assign
Base class for types that should not be assigned.
Definition: tbb_stddef.h:322
tbb::internal::task_prefix::owner
scheduler * owner
Obsolete. The scheduler that owns the task.
Definition: task.h:236
task
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
Definition: ittnotify_static.h:119
tbb::task_group_context::my_exception
exception_container_type * my_exception
Pointer to the container storing exception being propagated across this task group.
Definition: task.h:438
tbb::internal::task_prefix::next
tbb::task * next
"next" field for list of task
Definition: task.h:286
tbb::internal::task_prefix::extra_state
unsigned char extra_state
Miscellaneous state that is not directly visible to users, stored as a byte for compactness.
Definition: task.h:281
tbb::task_list::~task_list
~task_list()
Destroys the list, but does not destroy the task objects.
Definition: task.h:1074
tbb::task_group_context::low_unused_state_bit
Definition: task.h:388
tbb::task_group_context::init
void __TBB_EXPORTED_METHOD init()
Out-of-line part of the constructor.
tbb::internal::function_task
Definition: task.h:1040
tbb::internal::tbb_exception_ptr
Exception container that preserves the exact copy of the original exception.
Definition: tbb_exception.h:325
tbb::task_group_context::my_owner
internal::generic_scheduler * my_owner
Scheduler instance that registered this context in its thread specific list.
Definition: task.h:441
tbb::task::cancel_group_execution
bool cancel_group_execution()
Initiates cancellation of all tasks in this cancellation group and its subordinate groups.
Definition: task.h:960
tbb::task::ready
task is in ready pool, or is going to be put there, or was just taken off.
Definition: task.h:630
tbb::internal::releasing
Definition: tbb_profiling.h:129
tbb::internal::task_prefix::state
unsigned char state
A task::state_type, stored as a byte for compactness.
Definition: task.h:272
tbb::task::allocate_root
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
Definition: task.h:652
tbb::task::context
task_group_context * context()
This method is deprecated and will be removed in the future.
Definition: task.h:867
tbb::task_group_context::traits_type
traits_type
Definition: task.h:371
tbb::task_group_context::my_parent
task_group_context * my_parent
Pointer to the context of the parent cancellation group. NULL for isolated contexts.
Definition: task.h:399
tbb::internal::context_list_node_t::my_next
context_list_node_t * my_next
Definition: task.h:140
tbb::task_list::task_list
task_list()
Construct empty list.
Definition: task.h:1071
tbb::internal::scheduler::spawn
virtual void spawn(task &first, task *&next)=0
For internal use only.
tbb::internal::task_prefix::isolation
isolation_tag isolation
The tag used for task isolation.
Definition: task.h:209
tbb::internal::scheduler::enqueue
virtual void enqueue(task &t, void *reserved)=0
For internal use only.
tbb::internal::reference_count
intptr_t reference_count
A reference count.
Definition: task.h:120
__itt_caller
struct ___itt_caller * __itt_caller
Definition: task.h:28
tbb::internal::function_task::function_task
function_task(F &&f)
Definition: task.h:1054
tbb::task_list::empty
bool empty() const
True if list is empty; false otherwise.
Definition: task.h:1077
tbb::task
Base class for user-defined tasks.
Definition: task.h:604
tbb::priority_high
Definition: task.h:309
tbb::internal::task_prefix::origin
scheduler * origin
The scheduler that allocated the task, or NULL if the task is big.
Definition: task.h:228
tbb::internal::generic_scheduler
Work stealing task scheduler.
Definition: scheduler.h:137
name
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
Definition: ittnotify_static.h:93
tbb::task_group_context::my_name
internal::string_index my_name
Description of algorithm for scheduler based instrumentation.
Definition: task.h:452
tbb_stddef.h
tbb::task_group_context::my_cpu_ctl_env
internal::cpu_ctl_env_space my_cpu_ctl_env
Space for platform-specific FPU settings.
Definition: task.h:425
tbb::task_group_context::binding_required
static const kind_type binding_required
Definition: task.h:578
tbb::task::allocate_continuation
internal::allocate_continuation_proxy & allocate_continuation()
Returns proxy for overloaded new that allocates a continuation task of *this.
Definition: task.h:665
_warning_suppress_enable_notice.h
p
void const char const char int ITT_FORMAT __itt_group_sync p
Definition: ittnotify_static.h:91
__TBB_EXPORTED_METHOD
#define __TBB_EXPORTED_METHOD
Definition: tbb_stddef.h:98
tbb::interface5::internal::task_base::destroy
static void __TBB_EXPORTED_FUNC destroy(task &victim)
Destroy a task.
Definition: task.cpp:212
tbb::internal::call_itt_notify
void call_itt_notify(notify_type, void *)
Definition: tbb_profiling.h:276
tbb::internal::task_prefix::context
task_group_context * context
Shared context that is used to communicate asynchronous state changes.
Definition: task.h:219
tbb::task_group_context::task_group_context
task_group_context(kind_type relation_with_parent=bound, uintptr_t t=default_traits)
Default & binding constructor.
Definition: task.h:493
tbb::internal::context_list_node_t::my_prev
context_list_node_t * my_prev
Definition: task.h:140
tbb::task_group_context::next_state_value
Definition: task.h:388
tbb::internal::make_critical
void make_critical(task &t)
Definition: task.h:1002
tbb::internal::allocate_additional_child_of_proxy::allocate_additional_child_of_proxy
allocate_additional_child_of_proxy(task &parent_)
Definition: task.h:51
tbb::interface7::task_arena
Definition: task_arena.h:228
tbb::task_group_context::traits
uintptr_t traits() const
Returns the context's trait.
Definition: task.h:567
tbb::task::is_cancelled
bool is_cancelled() const
Returns true if the context has received cancellation request.
Definition: task.h:963
__TBB_FetchAndIncrementWacquire
#define __TBB_FetchAndIncrementWacquire(P)
Definition: tbb_machine.h:313
tbb::task::change_group
void __TBB_EXPORTED_METHOD change_group(task_group_context &ctx)
Moves this task from its current group into another one.
tbb::task_list::clear
void clear()
Clear the list.
Definition: task.h:1107
tbb::task_group_context::set_priority
__TBB_DEPRECATED void set_priority(priority_t)
Changes priority of the task group.
tbb::task_group_context::register_with
void register_with(internal::generic_scheduler *local_sched)
Registers this context with the local scheduler.
tbb::task::set_affinity
void set_affinity(affinity_id id)
Set affinity for this task.
Definition: task.h:932
tbb::task::spawn_root_and_wait
static void spawn_root_and_wait(task &root)
Spawn task allocated by allocate_root, wait for it to complete, and deallocate it.
Definition: task.h:797
tbb::task_group_context::may_have_children
Definition: task.h:386
tbb::task_group_context::my_priority
intptr_t my_priority
Priority level of the task group (in normalized representation)
Definition: task.h:448
tbb::task::set_group_priority
__TBB_DEPRECATED void set_group_priority(priority_t p)
Changes priority of the task group this task belongs to.
Definition: task.h:970
tbb::empty_task::execute
task * execute() __TBB_override
Should be overridden by derived classes.
Definition: task.h:1032
tbb::task_group_context::itt_caller
__itt_caller itt_caller
Used to set and maintain stack stitching point for Intel Performance Tools.
Definition: task.h:407

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.