Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface9::internal::flag_task Class Reference

Join task node that contains shared flag for stealing feedback. More...

#include <partitioner.h>

Inheritance diagram for tbb::interface9::internal::flag_task:
Collaboration diagram for tbb::interface9::internal::flag_task:

Public Member Functions

 flag_task ()
 
taskexecute () __TBB_override
 Should be overridden by derived classes. More...
 
- Public Member Functions inherited from tbb::task
virtual ~task ()
 Destructor. More...
 
internal::allocate_continuation_proxyallocate_continuation ()
 Returns proxy for overloaded new that allocates a continuation task of *this. More...
 
internal::allocate_child_proxyallocate_child ()
 Returns proxy for overloaded new that allocates a child task of *this. More...
 
void recycle_as_continuation ()
 Change this to be a continuation of its former self. More...
 
void recycle_as_safe_continuation ()
 Recommended to use, safe variant of recycle_as_continuation. More...
 
void recycle_as_child_of (task &new_parent)
 Change this to be a child of new_parent. More...
 
void recycle_to_reexecute ()
 Schedule this for reexecution after current execute() returns. More...
 
void set_ref_count (int count)
 Set reference count. More...
 
void increment_ref_count ()
 Atomically increment reference count. More...
 
int add_ref_count (int count)
 Atomically adds to reference count and returns its new value. More...
 
int decrement_ref_count ()
 Atomically decrement reference count and returns its new value. More...
 
void spawn_and_wait_for_all (task &child)
 Similar to spawn followed by wait_for_all, but more efficient. More...
 
void __TBB_EXPORTED_METHOD spawn_and_wait_for_all (task_list &list)
 Similar to spawn followed by wait_for_all, but more efficient. More...
 
void wait_for_all ()
 Wait for reference count to become one, and set reference count to zero. More...
 
taskparent () const
 task on whose behalf this task is working, or NULL if this is a root. More...
 
void set_parent (task *p)
 sets parent task pointer to specified value More...
 
task_group_contextcontext ()
 This method is deprecated and will be removed in the future. More...
 
task_group_contextgroup ()
 Pointer to the task group descriptor. More...
 
bool is_stolen_task () const
 True if task was stolen from the task pool of another thread. More...
 
bool is_enqueued_task () const
 True if the task was enqueued. More...
 
state_type state () const
 Current execution state. More...
 
int ref_count () const
 The internal reference count. More...
 
bool __TBB_EXPORTED_METHOD is_owned_by_current_thread () const
 Obsolete, and only retained for the sake of backward compatibility. Always returns true. More...
 
void set_affinity (affinity_id id)
 Set affinity for this task. More...
 
affinity_id affinity () const
 Current affinity of this task. More...
 
virtual void __TBB_EXPORTED_METHOD note_affinity (affinity_id id)
 Invoked by scheduler to notify task that it ran on unexpected thread. More...
 
void __TBB_EXPORTED_METHOD change_group (task_group_context &ctx)
 Moves this task from its current group into another one. More...
 
bool cancel_group_execution ()
 Initiates cancellation of all tasks in this cancellation group and its subordinate groups. More...
 
bool is_cancelled () const
 Returns true if the context has received cancellation request. More...
 
__TBB_DEPRECATED void set_group_priority (priority_t p)
 Changes priority of the task group this task belongs to. More...
 
__TBB_DEPRECATED priority_t group_priority () const
 Retrieves current priority of the task group this task belongs to. More...
 

Static Public Member Functions

static void mark_task_stolen (task &t)
 
static bool is_peer_stolen (task &t)
 
- Static Public Member Functions inherited from tbb::task
static internal::allocate_root_proxy allocate_root ()
 Returns proxy for overloaded new that allocates a root task. More...
 
static internal::allocate_root_with_context_proxy allocate_root (task_group_context &ctx)
 Returns proxy for overloaded new that allocates a root task associated with user supplied context. More...
 
static void spawn_root_and_wait (task &root)
 Spawn task allocated by allocate_root, wait for it to complete, and deallocate it. More...
 
static void spawn_root_and_wait (task_list &root_list)
 Spawn root tasks on list and wait for all of them to finish. More...
 
static void enqueue (task &t)
 Enqueue task for starvation-resistant execution. More...
 
static void enqueue (task &t, priority_t p)
 Enqueue task for starvation-resistant execution on the specified priority level. More...
 
static void enqueue (task &t, task_arena &arena, priority_t p=priority_t(0))
 Enqueue task in task_arena. More...
 
static task &__TBB_EXPORTED_FUNC self ()
 The innermost task being executed or destroyed by the current thread at the moment. More...
 

Public Attributes

tbb::atomic< bool > my_child_stolen
 

Additional Inherited Members

- Public Types inherited from tbb::task
enum  state_type {
  executing, reexecute, ready, allocated,
  freed, recycle
}
 Enumeration of task states that the scheduler considers. More...
 
typedef internal::affinity_id affinity_id
 An id as used for specifying affinity. More...
 
- Protected Member Functions inherited from tbb::task
 task ()
 Default constructor. More...
 

Detailed Description

Join task node that contains shared flag for stealing feedback.

Definition at line 128 of file partitioner.h.

Constructor & Destructor Documentation

◆ flag_task()

tbb::interface9::internal::flag_task::flag_task ( )
inline

Definition at line 131 of file partitioner.h.

131 { my_child_stolen = false; }
tbb::atomic< bool > my_child_stolen
Definition: partitioner.h:130

Member Function Documentation

◆ execute()

task* tbb::interface9::internal::flag_task::execute ( )
inlinevirtual

Should be overridden by derived classes.

Implements tbb::task.

Definition at line 132 of file partitioner.h.

132 { return NULL; }

◆ is_peer_stolen()

static bool tbb::interface9::internal::flag_task::is_peer_stolen ( task t)
inlinestatic

Definition at line 142 of file partitioner.h.

142  {
143  return static_cast<flag_task*>(t.parent())->my_child_stolen;
144  }
tbb::atomic< bool > my_child_stolen
Definition: partitioner.h:130

References tbb::task::parent().

Referenced by tbb::interface9::internal::dynamic_grainsize_mode< linear_affinity_mode< affinity_partition_type > >::check_for_demand(), and tbb::interface9::internal::auto_partition_type::check_for_demand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mark_task_stolen()

static void tbb::interface9::internal::flag_task::mark_task_stolen ( task t)
inlinestatic

Definition at line 133 of file partitioner.h.

133  {
134  tbb::atomic<bool> &flag = static_cast<flag_task*>(t.parent())->my_child_stolen;
135 #if TBB_USE_THREADING_TOOLS
136  // Threading tools respect lock prefix but report false-positive data-race via plain store
137  flag.fetch_and_store<release>(true);
138 #else
139  flag = true;
140 #endif //TBB_USE_THREADING_TOOLS
141  }
Release.
Definition: atomic.h:59
tbb::atomic< bool > my_child_stolen
Definition: partitioner.h:130

References tbb::task::parent(), and tbb::release.

Referenced by tbb::interface9::internal::dynamic_grainsize_mode< linear_affinity_mode< affinity_partition_type > >::check_being_stolen().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ my_child_stolen

tbb::atomic<bool> tbb::interface9::internal::flag_task::my_child_stolen

Definition at line 130 of file partitioner.h.


The documentation for this class was generated from the following file:

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.