Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
#include <task_scheduler_observer.h>
Public Member Functions | |
task_scheduler_observer (bool local=false) | |
Construct local or global observer in inactive state (observation disabled). More... | |
task_scheduler_observer (task_arena &a) | |
Construct local observer for a given arena in inactive state (observation disabled). More... | |
virtual | ~task_scheduler_observer () |
void | observe (bool state=true) |
Enable or disable observation. More... | |
![]() | |
void __TBB_EXPORTED_METHOD | observe (bool state=true) |
Enable or disable observation. More... | |
bool | is_observing () const |
Returns true if observation is enabled, false otherwise. More... | |
task_scheduler_observer_v3 () | |
Construct observer with observation disabled. More... | |
virtual void | on_scheduler_entry (bool) |
Entry notification. More... | |
virtual void | on_scheduler_exit (bool) |
Exit notification. More... | |
virtual | ~task_scheduler_observer_v3 () |
Destructor automatically switches observation off if it is enabled. More... | |
Private Types | |
enum | { global_tag = 0, implicit_tag = 1 } |
Private Attributes | |
intptr_t | my_context_tag |
contains task_arena pointer or tag indicating local or global semantics of the observer More... | |
Static Private Attributes | |
static const intptr_t | v6_trait = (intptr_t)((~(uintptr_t)0 >> 1) + 1) |
Friends | |
class | internal::task_scheduler_observer_v3 |
class | internal::observer_proxy |
class | internal::observer_list |
Definition at line 92 of file task_scheduler_observer.h.
|
private |
Enumerator | |
---|---|
global_tag | |
implicit_tag |
Definition at line 104 of file task_scheduler_observer.h.
|
inlineexplicit |
Construct local or global observer in inactive state (observation disabled).
For a local observer entry/exit notifications are invoked whenever a worker thread joins/leaves the arena of the observer's owner thread. If a thread is already in the arena when the observer is activated, the entry notification is called before it executes the first stolen task. TODO: Obsolete. Global observer semantics is obsolete as it violates master thread isolation guarantees and is not composable. Thus the current default behavior of the constructor is obsolete too and will be changed in one of the future versions of the library.
Definition at line 117 of file task_scheduler_observer.h.
References __TBB_ASSERT_EX, global_tag, implicit_tag, and my_context_tag.
|
inlineexplicit |
Construct local observer for a given arena in inactive state (observation disabled).
entry/exit notifications are invoked whenever a thread joins/leaves arena. If a thread is already in the arena when the observer is activated, the entry notification is called before it executes the first stolen task.
Definition at line 131 of file task_scheduler_observer.h.
References my_context_tag.
|
inlinevirtual |
Destructor protects instance of the observer from concurrent notification. It is recommended to disable observation before destructor of a derived class starts, otherwise it can lead to concurrent notification callback on partly destroyed object
Definition at line 139 of file task_scheduler_observer.h.
References tbb::internal::task_scheduler_observer_v3::my_proxy, and observe().
|
inline |
Enable or disable observation.
Warning: concurrent invocations of this method are not safe. Repeated calls with the same state are no-ops.
Definition at line 144 of file task_scheduler_observer.h.
References __TBB_ASSERT, tbb::internal::task_scheduler_observer_v3::my_busy_count, tbb::internal::task_scheduler_observer_v3::my_proxy, tbb::internal::task_scheduler_observer_v3::observe(), tbb::relaxed, and v6_trait.
Referenced by ~task_scheduler_observer().
|
friend |
Definition at line 95 of file task_scheduler_observer.h.
|
friend |
Definition at line 94 of file task_scheduler_observer.h.
|
friend |
Definition at line 93 of file task_scheduler_observer.h.
|
private |
contains task_arena pointer or tag indicating local or global semantics of the observer
Definition at line 103 of file task_scheduler_observer.h.
Referenced by task_scheduler_observer().
|
staticprivate |
Negative numbers with the largest absolute value to minimize probability of coincidence in case of a bug in busy count usage.
Definition at line 100 of file task_scheduler_observer.h.
Referenced by observe().