tbb::internal::allocate_additional_child_of_proxy Class Reference

`#include <task.h>`

Inheritance diagram for tbb::internal::allocate_additional_child_of_proxy:
Collaboration diagram for tbb::internal::allocate_additional_child_of_proxy:

## Public Member Functions

| allocate_additional_child_of_proxy (task &parent_)
task &__TBB_EXPORTED_METHOD | allocate (size_t size) const
void __TBB_EXPORTED_METHOD | free (task &) const

## Private Attributes

task * | self
| No longer used, but retained for binary layout compatibility. Always NULL. More...
task & | parent

## Additional Inherited Members

Private Member Functions inherited from tbb::internal::no_assign
void | operator= (const no_assign &)=delete
| no_assign (const no_assign &)=default
| no_assign ()=default

## Detailed Description

Definition at line 46 of file task.h.

## Constructor & Destructor Documentation

## allocate_additional_child_of_proxy()

tbb::internal::allocate_additional_child_of_proxy::allocate_additional_child_of_proxy | ( | task & | parent_ | ) |

inline explicit

Definition at line 51 of file task.h.

: self(NULL), parent(parent_) {
suppress_unused_warning( self );
}

References tbb::internal::suppress_unused_warning().

Here is the call graph for this function:

## Member Function Documentation

## allocate()

task & tbb::internal::allocate_additional_child_of_proxy::allocate | ( | size_t | size | ) | const

Definition at line 128 of file task.cpp.

{
parent.increment_ref_count();
generic_scheduler* s = governor::local_scheduler_weak();
return s->allocate_task( size, __TBB_CONTEXT_ARG(&parent, parent.prefix().context) );
}

References __TBB_CONTEXT_ARG, tbb::internal::task_prefix::context, tbb::task::increment_ref_count(), tbb::internal::governor::local_scheduler_weak(), parent, tbb::task::prefix(), s, and size.

Here is the call graph for this function:

## free()

void tbb::internal::allocate_additional_child_of_proxy::free | ( | task & | task | ) | const

Definition at line 134 of file task.cpp.

{
// Undo the increment. We do not check the result of the fetch-and-decrement.
// We could consider be spawning the task if the fetch-and-decrement returns 1.
// But we do not know that was the programmer's intention.
// Furthermore, if it was the programmer's intention, the program has a fundamental
// race condition (that we warn about in Reference manual), because the
// reference count might have become zero before the corresponding call to
// allocate_additional_child_of_proxy::allocate.
parent.internal_decrement_ref_count();
governor::local_scheduler_weak()->free_task<local_task>(task);
}

References tbb::internal::generic_scheduler::free_task(), tbb::task::internal_decrement_ref_count(), tbb::internal::governor::local_scheduler_weak(), tbb::internal::local_task, parent, and task.

Here is the call graph for this function:

## Member Data Documentation

## parent

task& tbb::internal::allocate_additional_child_of_proxy::parent

private

Definition at line 49 of file task.h.

Referenced by allocate(), and free().

## self

task* tbb::internal::allocate_additional_child_of_proxy::self

private

No longer used, but retained for binary layout compatibility. Always NULL.

Definition at line 48 of file task.h.

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

- task.h
- task.cpp

tbb::task::prefix
internal::task_prefix & prefix(internal::version_tag *=NULL) const
Get reference to corresponding task_prefix.
Definition: task.h:991
tbb::internal::allocate_additional_child_of_proxy::parent
task & parent
Definition: task.h:49
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
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::increment_ref_count
void increment_ref_count()
Atomically increment reference count.
Definition: task.h:760
s
void const char const char int ITT_FORMAT __itt_group_sync s
Definition: ittnotify_static.h:91
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
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::internal::generic_scheduler::free_task
void free_task(task &t)
Put task on free list.
Definition: scheduler.h:730
tbb::internal::local_task
Task is known to have been allocated by this scheduler.
Definition: scheduler_common.h:190
tbb::internal::generic_scheduler
Work stealing task scheduler.
Definition: scheduler.h:137
tbb::internal::governor::local_scheduler_weak
static generic_scheduler * local_scheduler_weak()
Definition: governor.h:134
tbb::internal::task_prefix::context
task_group_context * context
Shared context that is used to communicate asynchronous state changes.
Definition: task.h:219
__TBB_CONTEXT_ARG
#define __TBB_CONTEXT_ARG(arg1, context)
Definition: scheduler_common.h:60

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.