Public Member Functions | Friends | List of all members
tbb::interface6::task_scheduler_observer Class Reference
Inheritance diagram for tbb::interface6::task_scheduler_observer:
tbb::internal::task_scheduler_observer_v3

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
 

Constructor & Destructor Documentation

tbb::interface6::task_scheduler_observer::task_scheduler_observer ( bool  local = false)
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.

tbb::interface6::task_scheduler_observer::task_scheduler_observer ( task_arena &  a)
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.

Member Function Documentation

virtual bool tbb::interface6::task_scheduler_observer::on_scheduler_leaving ( )
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


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

Copyright © 2005-2014 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.