Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Base class for user-defined tasks. More...
#include <task.h>
Public Types | |
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... | |
Public Member Functions | |
virtual | ~task () |
Destructor. More... | |
virtual task * | execute ()=0 |
Should be overridden by derived classes. More... | |
internal::allocate_continuation_proxy & | allocate_continuation () |
Returns proxy for overloaded new that allocates a continuation task of *this. More... | |
internal::allocate_child_proxy & | allocate_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... | |
task * | parent () 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_context * | context () |
This method is deprecated and will be removed in the future. More... | |
task_group_context * | group () |
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 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 __TBB_DEPRECATED void | enqueue (task &t, priority_t p) |
Enqueue task for starvation-resistant execution on the specified priority level. More... | |
static __TBB_DEPRECATED 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... | |
Protected Member Functions | |
task () | |
Default constructor. More... | |
Private Member Functions | |
void __TBB_EXPORTED_METHOD | internal_set_ref_count (int count) |
Set reference count. More... | |
internal::reference_count __TBB_EXPORTED_METHOD | internal_decrement_ref_count () |
Decrement reference count and return its new value. More... | |
internal::task_prefix & | prefix (internal::version_tag *=NULL) const |
Get reference to corresponding task_prefix. More... | |
Friends | |
class | interface5::internal::task_base |
class | task_list |
class | internal::scheduler |
class | internal::allocate_root_proxy |
class | internal::allocate_root_with_context_proxy |
class | internal::allocate_continuation_proxy |
class | internal::allocate_child_proxy |
class | internal::allocate_additional_child_of_proxy |
void | internal::make_critical (task &) |
bool | internal::is_critical (task &) |
Enumeration of task states that the scheduler considers.
Enumerator | |
---|---|
executing | task is running, and will be destroyed after method execute() completes. |
reexecute | task to be rescheduled. |
ready | task is in ready pool, or is going to be put there, or was just taken off. |
allocated | task object is freshly allocated or recycled. |
freed | task object is on free list, or is going to be put there, or was just taken off. |
recycle | task to be recycled as continuation |
Definition at line 624 of file task.h.
|
inlineprotected |
Default constructor.
Definition at line 614 of file task.h.
References tbb::internal::task_prefix::extra_state, and prefix().
|
inlinevirtual |
Destructor.
Definition at line 618 of file task.h.
Referenced by tbb::interface5::internal::task_base::destroy(), and tbb::internal::custom_scheduler< SchedulerTraits >::process_bypass_loop().
Atomically adds to reference count and returns its new value.
Has release-acquire semantics
Definition at line 766 of file task.h.
References __TBB_ASSERT, tbb::internal::acquired, tbb::internal::call_itt_notify(), count, int, prefix(), ref_count(), and tbb::internal::releasing.
|
inline |
Current affinity of this task.
Definition at line 935 of file task.h.
References tbb::internal::task_prefix::affinity, and prefix().
|
inline |
Returns proxy for overloaded new that allocates a child task of *this.
Definition at line 670 of file task.h.
Referenced by tbb::internal::parallel_invoke_helper::add_children(), tbb::interface9::internal::allocate_sibling(), tbb::internal::spawner< N, function1, function2, function3 >::execute(), tbb::internal::while_group_task< Body >::execute(), tbb::interface9::internal::do_group_task_forward< Iterator, Body, Item >::execute(), tbb::interface9::internal::do_group_task_input< Body, Item >::execute(), tbb::internal::pipeline_root_task::execute(), tbb::internal::parallel_invoke_helper::run_and_finish(), and tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_random_access_iterator().
|
inline |
Returns proxy for overloaded new that allocates a continuation task of *this.
The continuation's parent becomes the parent of *this.
Definition at line 665 of file task.h.
Referenced by tbb::interface9::internal::allocate_sibling(), tbb::flow::interface11::internal::prioritize_task(), and tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_random_access_iterator().
|
inlinestatic |
Returns proxy for overloaded new that allocates a root task.
Definition at line 652 of file task.h.
Referenced by tbb::interface7::task_arena::enqueue_impl(), tbb::internal::start_scan< Range, Body, Partitioner >::execute(), tbb::interface9::internal::parallel_do_feeder_impl< Body, Item >::parallel_do_feeder_impl(), tbb::interface9::internal::start_for< Range, Body, Partitioner >::run(), tbb::interface9::internal::start_reduce< Range, Body, Partitioner >::run(), tbb::parallel_while< Body >::run(), tbb::internal::start_scan< Range, Body, Partitioner >::run(), tbb::interface9::internal::start_deterministic_reduce< Range, Body, Partitioner >::run(), and tbb::internal::task_group_base::task_group_base().
|
inlinestatic |
Returns proxy for overloaded new that allocates a root task associated with user supplied context.
Definition at line 658 of file task.h.
|
inline |
Initiates cancellation of all tasks in this cancellation group and its subordinate groups.
Definition at line 960 of file task.h.
References tbb::task_group_context::cancel_group_execution(), tbb::internal::task_prefix::context, and prefix().
Referenced by tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::operator()().
void __TBB_EXPORTED_METHOD tbb::task::change_group | ( | task_group_context & | ctx | ) |
Moves this task from its current group into another one.
Argument ctx specifies the new group.
The primary purpose of this method is to associate unique task group context with a task allocated for subsequent enqueuing. In contrast to spawned tasks enqueued ones normally outlive the scope where they were created. This makes traditional usage model where task group context are allocated locally on the stack inapplicable. Dynamic allocation of context objects is performance inefficient. Method change_group() allows to make task group context object a member of the task class, and then associate it with its containing task object in the latter's constructor.
|
inline |
This method is deprecated and will be removed in the future.
Use method group() instead.
Definition at line 867 of file task.h.
References tbb::internal::task_prefix::context, and prefix().
Referenced by tbb::internal::generic_scheduler::prepare_for_spawning(), tbb::interface9::internal::start_for< Range, Body, Partitioner >::run(), and set_parent().
|
inline |
Atomically decrement reference count and returns its new value.
Has release semantics.
Definition at line 777 of file task.h.
References __TBB_FetchAndDecrementWrelease, int, internal_decrement_ref_count(), prefix(), and ref_count().
Referenced by tbb::internal::task_group_base::ref_count_guard::~ref_count_guard().
Enqueue task for starvation-resistant execution.
The task will be enqueued on the normal priority level disregarding the priority of its task group.
The rationale of such semantics is that priority of an enqueued task is statically fixed at the moment of its enqueuing, while task group priority is dynamic. Thus automatic priority inheritance would be generally a subject to the race, which may result in unexpected behavior.
Use enqueue() overload with explicit priority value and task::group_priority() method to implement such priority inheritance when it is really necessary.
Definition at line 825 of file task.h.
References tbb::internal::scheduler::enqueue(), tbb::internal::task_prefix::owner, and prefix().
Referenced by enqueue(), and tbb::flow::interface11::internal::enqueue_in_graph_arena().
|
inlinestatic |
Enqueue task for starvation-resistant execution on the specified priority level.
Definition at line 831 of file task.h.
|
inlinestatic |
Enqueue task in task_arena.
Enqueue task in task_arena The implementation is in task_arena.h
Note: the context of the task may differ from the context instantiated by task_arena
Definition at line 492 of file task_arena.h.
|
pure virtual |
Should be overridden by derived classes.
Implemented in tbb::flow::interface11::overwrite_node< T >::register_predecessor_task, tbb::internal::function_task< F >, tbb::empty_task, tbb::internal::pipeline_root_task, tbb::flow::interface11::internal::source_task_bypass< NodeType >, tbb::interface9::internal::do_task_iter< Iterator, Body, Item >, tbb::flow::interface11::internal::apply_body_task_bypass< NodeType, Input >, tbb::flow::interface11::internal::forward_task_bypass< NodeType >, tbb::internal::stage_task, tbb::interface9::internal::do_group_task_input< Body, Item >, tbb::flow::interface10::graph::run_and_put_task< Receiver, Body >, tbb::interface9::internal::start_deterministic_reduce< Range, Body, Partitioner >, tbb::interface9::internal::do_group_task_forward< Iterator, Body, Item >, tbb::flow::interface10::graph::run_task< Body >, tbb::interface9::internal::finish_deterministic_reduce< Body >, tbb::internal::start_scan< Range, Body, Partitioner >, tbb::flow::interface11::internal::priority_task_selector, tbb::internal::finish_scan< Range, Body >, tbb::interface9::internal::do_iteration_task_iter< Iterator, Body, Item >, tbb::interface9::internal::flag_task, tbb::internal::sum_node< Range, Body >, tbb::interface9::internal::do_iteration_task< Body, Item >, tbb::interface9::internal::start_reduce< Range, Body, Partitioner >, tbb::internal::while_task< Stream, Body >, tbb::internal::task_handle_task< F >, tbb::internal::final_sum< Range, Body >, tbb::internal::spawner< N, function1, function2, function3 >, tbb::interface9::internal::finish_reduce< Body >, tbb::internal::while_group_task< Body >, tbb::internal::function_invoker< function >, tbb::interface9::internal::start_for< Range, Body, Partitioner >, and tbb::internal::while_iteration_task< Body >.
Referenced by tbb::interface9::internal::start_for< Range, Body, Partitioner >::execute(), tbb::flow::interface11::internal::priority_task_selector::execute(), tbb::interface9::internal::start_deterministic_reduce< Range, Body, Partitioner >::execute(), and tbb::internal::custom_scheduler< SchedulerTraits >::process_bypass_loop().
|
inline |
Pointer to the task group descriptor.
Definition at line 870 of file task.h.
References tbb::internal::task_prefix::context, and prefix().
|
inline |
Retrieves current priority of the task group this task belongs to.
Definition at line 973 of file task.h.
References tbb::internal::task_prefix::context, prefix(), and tbb::task_group_context::priority().
|
inline |
Atomically increment reference count.
Has acquire semantics
Definition at line 760 of file task.h.
References __TBB_FetchAndIncrementWacquire, prefix(), and ref_count().
Referenced by tbb::internal::allocate_additional_child_of_proxy::allocate(), tbb::internal::task_group_base::ref_count_guard::ref_count_guard(), and tbb::flow::interface10::graph::reserve_wait().
|
private |
Decrement reference count and return its new value.
Definition at line 192 of file task.cpp.
References __TBB_ASSERT, __TBB_FetchAndDecrementWrelease, ITT_NOTIFY, and sync_releasing.
Referenced by decrement_ref_count(), and tbb::internal::allocate_additional_child_of_proxy::free().
Set reference count.
Definition at line 183 of file task.cpp.
References __TBB_ASSERT, count, tbb::internal::es_ref_count_active, ITT_NOTIFY, p, and sync_releasing.
Referenced by set_ref_count().
|
inline |
Returns true if the context has received cancellation request.
Definition at line 963 of file task.h.
References tbb::internal::task_prefix::context, tbb::task_group_context::is_group_execution_cancelled(), and prefix().
Referenced by tbb::is_current_task_group_canceling(), and tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::operator()().
|
inline |
True if the task was enqueued.
Definition at line 879 of file task.h.
References prefix().
Referenced by tbb::internal::custom_scheduler< SchedulerTraits >::process_bypass_loop().
bool tbb::task::is_owned_by_current_thread | ( | ) | const |
|
inline |
True if task was stolen from the task pool of another thread.
Definition at line 874 of file task.h.
References prefix().
Referenced by tbb::interface9::internal::dynamic_grainsize_mode< linear_affinity_mode< affinity_partition_type > >::check_being_stolen(), and tbb::interface9::internal::old_auto_partition_type::should_execute_range().
|
virtual |
Invoked by scheduler to notify task that it ran on unexpected thread.
Invoked before method execute() runs, if task is stolen, or task has affinity but will be executed on another thread.
The default action does nothing.
Defined out of line so that compiler does not replicate task's vtable. It's pointless to define it inline anyway, because all call sites to it are virtual calls that the compiler is unlikely to optimize.
Reimplemented in tbb::interface9::internal::start_reduce< Range, Body, Partitioner >, and tbb::interface9::internal::start_for< Range, Body, Partitioner >.
Definition at line 245 of file task.cpp.
Referenced by tbb::internal::generic_scheduler::get_task(), and tbb::internal::generic_scheduler::steal_task().
|
inline |
task on whose behalf this task is working, or NULL if this is a root.
Definition at line 854 of file task.h.
References tbb::internal::task_prefix::parent, and prefix().
Referenced by tbb::internal::allocate_continuation_proxy::allocate(), tbb::interface9::internal::dynamic_grainsize_mode< linear_affinity_mode< affinity_partition_type > >::check_being_stolen(), tbb::interface5::internal::task_base::destroy(), tbb::internal::arena::enqueue_task(), tbb::internal::stage_task::execute(), tbb::internal::allocate_continuation_proxy::free(), tbb::interface9::internal::flag_task::is_peer_stolen(), tbb::internal::custom_scheduler< SchedulerTraits >::local_wait_for_all(), tbb::interface9::internal::flag_task::mark_task_stolen(), tbb::internal::generic_scheduler::prepare_for_spawning(), and tbb::internal::custom_scheduler< SchedulerTraits >::process_bypass_loop().
|
inlineprivate |
Get reference to corresponding task_prefix.
Version tag prevents loader on Linux from using the wrong symbol in debug builds.
Definition at line 991 of file task.h.
Referenced by add_ref_count(), affinity(), tbb::internal::allocate_additional_child_of_proxy::allocate(), tbb::internal::allocate_root_proxy::allocate(), tbb::internal::allocate_continuation_proxy::allocate(), tbb::internal::allocate_child_proxy::allocate(), tbb::internal::generic_scheduler::allocate_task(), tbb::internal::generic_scheduler::attach_arena(), cancel_group_execution(), tbb::internal::generic_scheduler::cleanup_scheduler(), context(), tbb::internal::generic_scheduler::create_master(), tbb::internal::generic_scheduler::deallocate_task(), decrement_ref_count(), tbb::interface5::internal::task_base::destroy(), enqueue(), tbb::internal::arena::enqueue_task(), tbb::internal::task_proxy::extract_task(), tbb::internal::generic_scheduler::free_nonlocal_small_task(), tbb::internal::generic_scheduler::free_task(), tbb::internal::generic_scheduler::generic_scheduler(), tbb::internal::generic_scheduler::get_task(), group(), group_priority(), increment_ref_count(), is_cancelled(), tbb::internal::is_critical(), is_enqueued_task(), tbb::internal::generic_scheduler::is_proxy(), is_stolen_task(), tbb::internal::generic_scheduler::is_version_3_task(), tbb::internal::generic_scheduler::local_spawn(), tbb::internal::generic_scheduler::local_spawn_root_and_wait(), tbb::internal::custom_scheduler< SchedulerTraits >::local_wait_for_all(), tbb::internal::task_stream< num_priority_levels >::look_specific(), tbb::internal::make_critical(), tbb::internal::nested_arena_context::mimic_outermost_level(), parent(), tbb::internal::auto_empty_task::prefix(), tbb::internal::generic_scheduler::prepare_for_spawning(), tbb::internal::custom_scheduler< SchedulerTraits >::process_bypass_loop(), tbb::task_list::push_back(), recycle_as_child_of(), recycle_as_continuation(), recycle_as_safe_continuation(), recycle_to_reexecute(), ref_count(), tbb::internal::reset_extra_state(), set_affinity(), set_parent(), set_ref_count(), tbb::interface5::internal::task_base::spawn(), spawn_and_wait_for_all(), spawn_root_and_wait(), state(), tbb::internal::generic_scheduler::steal_task(), tbb::internal::generic_scheduler::steal_task_from(), tbb::internal::custom_scheduler< SchedulerTraits >::tally_completion_of_predecessor(), task(), wait_for_all(), tbb::internal::generic_scheduler::wait_until_empty(), and tbb::internal::nested_arena_context::~nested_arena_context().
Change this to be a child of new_parent.
Definition at line 714 of file task.h.
References __TBB_ASSERT, allocated, tbb::internal::task_prefix::context, executing, freed, p, prefix(), recycle, ref_count(), tbb::internal::task_prefix::state, and state().
Referenced by tbb::internal::sum_node< Range, Body >::create_child(), and tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_random_access_iterator().
|
inline |
Change this to be a continuation of its former self.
The caller must guarantee that the task's refcount does not become zero until after the method execute() returns. Typically, this is done by having method execute() return a pointer to a child of the task. If the guarantee cannot be made, use method recycle_as_safe_continuation instead.
Because of the hazard, this method may be deprecated in the future.
Definition at line 700 of file task.h.
References __TBB_ASSERT, allocated, executing, prefix(), tbb::internal::task_prefix::state, and state().
Referenced by tbb::internal::sum_node< Range, Body >::execute(), tbb::internal::stage_task::execute(), and tbb::internal::pipeline_root_task::execute().
|
inline |
Recommended to use, safe variant of recycle_as_continuation.
For safety, it requires additional increment of ref_count. With no descendants and ref_count of 1, it has the semantics of recycle_to_reexecute.
Definition at line 708 of file task.h.
References __TBB_ASSERT, executing, prefix(), recycle, tbb::internal::task_prefix::state, and state().
Referenced by tbb::internal::spawner< N, function1, function2, function3 >::execute().
|
inline |
Schedule this for reexecution after current execute() returns.
Made obsolete by recycle_as_safe_continuation; may become deprecated.
Definition at line 730 of file task.h.
References __TBB_ASSERT, executing, prefix(), reexecute, ref_count(), tbb::internal::task_prefix::state, and state().
Referenced by tbb::internal::while_task< Stream, Body >::execute(), tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_forward_iterator(), and tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_input_iterator().
|
inline |
The internal reference count.
Definition at line 904 of file task.h.
References __TBB_ASSERT, int, prefix(), and tbb::internal::task_prefix::ref_count.
Referenced by add_ref_count(), tbb::interface9::internal::dynamic_grainsize_mode< linear_affinity_mode< affinity_partition_type > >::check_being_stolen(), decrement_ref_count(), tbb::internal::finish_scan< Range, Body >::execute(), increment_ref_count(), recycle_as_child_of(), recycle_to_reexecute(), and tbb::internal::task_group_base::~task_group_base().
|
static |
The innermost task being executed or destroyed by the current thread at the moment.
Definition at line 201 of file task.cpp.
References __TBB_ASSERT, tbb::internal::generic_scheduler::assert_task_pool_valid(), tbb::internal::governor::local_scheduler_weak(), and tbb::internal::scheduler_state::my_innermost_running_task.
Referenced by tbb::parallel_while< Body >::add(), tbb::is_current_task_group_canceling(), and tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::operator()().
|
inline |
Set affinity for this task.
Definition at line 932 of file task.h.
References tbb::internal::task_prefix::affinity, id, and prefix().
Referenced by tbb::interface9::internal::linear_affinity_mode< static_partition_type >::set_affinity(), and tbb::interface9::internal::affinity_partition_type::set_affinity().
|
inline |
Changes priority of the task group this task belongs to.
Definition at line 970 of file task.h.
sets parent task pointer to specified value
Definition at line 857 of file task.h.
References __TBB_ASSERT, context(), p, tbb::internal::task_prefix::parent, and prefix().
Referenced by tbb::interface9::internal::allocate_sibling().
Set reference count.
Definition at line 750 of file task.h.
References count, internal_set_ref_count(), prefix(), and tbb::internal::task_prefix::ref_count.
Referenced by tbb::interface9::internal::allocate_sibling(), tbb::internal::generic_scheduler::cleanup_master(), tbb::internal::while_group_task< Body >::execute(), tbb::internal::spawner< N, function1, function2, function3 >::execute(), tbb::internal::sum_node< Range, Body >::execute(), tbb::interface9::internal::do_group_task_forward< Iterator, Body, Item >::execute(), tbb::interface9::internal::do_group_task_input< Body, Item >::execute(), tbb::internal::pipeline_root_task::execute(), tbb::internal::parallel_invoke_helper::parallel_invoke_helper(), tbb::parallel_while< Body >::run(), tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_random_access_iterator(), tbb::internal::task_group_base::task_group_base(), and tbb::flow::interface10::graph::wait_for_all().
Similar to spawn followed by wait_for_all, but more efficient.
Definition at line 789 of file task.h.
References tbb::internal::task_prefix::owner, prefix(), and tbb::internal::scheduler::wait_for_all().
Referenced by tbb::internal::while_group_task< Body >::execute(), tbb::interface9::internal::do_group_task_forward< Iterator, Body, Item >::execute(), tbb::interface9::internal::do_group_task_input< Body, Item >::execute(), tbb::parallel_while< Body >::run(), tbb::internal::parallel_invoke_helper::run_and_finish(), and tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_random_access_iterator().
Similar to spawn followed by wait_for_all, but more efficient.
Definition at line 231 of file task.cpp.
References tbb::task_list::clear(), tbb::task_list::first, tbb::internal::governor::local_scheduler(), tbb::internal::task_prefix::next, tbb::task_list::next_ptr, prefix(), and s.
Spawn task allocated by allocate_root, wait for it to complete, and deallocate it.
Definition at line 797 of file task.h.
References tbb::internal::task_prefix::next, tbb::internal::task_prefix::owner, prefix(), and tbb::internal::scheduler::spawn_root_and_wait().
Referenced by tbb::interface9::internal::start_for< Range, Body, Partitioner >::run(), tbb::interface9::internal::start_reduce< Range, Body, Partitioner >::run(), tbb::internal::start_scan< Range, Body, Partitioner >::run(), and tbb::interface9::internal::start_deterministic_reduce< Range, Body, Partitioner >::run().
Spawn root tasks on list and wait for all of them to finish.
If there are more tasks than worker threads, the tasks are spawned in order of front to back.
Definition at line 1124 of file task.h.
References tbb::task_list::clear(), tbb::task_list::first, and tbb::task_list::next_ptr.
|
inline |
Current execution state.
Definition at line 901 of file task.h.
References prefix().
Referenced by tbb::internal::generic_scheduler::allocate_task(), tbb::interface5::internal::task_base::destroy(), tbb::internal::arena::enqueue_task(), tbb::internal::generic_scheduler::free_nonlocal_small_task(), tbb::internal::generic_scheduler::free_task(), tbb::internal::generic_scheduler::prepare_for_spawning(), tbb::internal::custom_scheduler< SchedulerTraits >::process_bypass_loop(), recycle_as_child_of(), recycle_as_continuation(), recycle_as_safe_continuation(), and recycle_to_reexecute().
|
inline |
Wait for reference count to become one, and set reference count to zero.
Works on tasks while waiting.
Definition at line 808 of file task.h.
References tbb::internal::task_prefix::owner, prefix(), and tbb::internal::scheduler::wait_for_all().
Referenced by tbb::flow::interface10::graph::wait_functor::operator()(), tbb::internal::task_group_base::wait(), and tbb::internal::task_group_base::~task_group_base().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |