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 () |
Destructor additionally protects concurrent on_scheduler_leaving notification. | |
virtual bool | on_scheduler_leaving () |
The callback can be invoked in a worker thread before it leaves an arena. More... | |
Public Member Functions inherited from tbb::internal::task_scheduler_observer_v3 | |
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. | |
task_scheduler_observer_v3 () | |
Construct observer with observation disabled. | |
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. | |
Friends | |
class | internal::task_scheduler_observer_v3 |
class | internal::observer_proxy |
class | internal::observer_list |
|
inline |
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.
References tbb::relaxed.
|
inline |
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.
References tbb::relaxed.
|
inlinevirtual |
The callback can be invoked in a worker thread before it leaves an arena.
If it returns false, the thread remains in the arena. Will not be called for masters or if the worker leaves arena due to rebalancing or priority changes, etc. NOTE: The preview library must be linked for this method to take effect