|
enum | { keep_awake = false,
allow_sleep = true
} |
| Return commands for may_sleep()
|
|
|
class | internal::task_scheduler_observer_v3 |
|
class | internal::observer_proxy |
|
class | internal::observer_list |
|
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.
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.
virtual tbb::interface6::task_scheduler_observer::~task_scheduler_observer |
( |
) | |
|
|
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
References observe().
virtual bool tbb::interface6::task_scheduler_observer::may_sleep |
( |
) | |
|
|
inlinevirtual |
The callback can be invoked by a worker thread before it goes to sleep.
If it returns false ('keep_awake'), the thread will keep spinning and looking for work. It will not be called for master threads.
void tbb::interface6::task_scheduler_observer::observe |
( |
bool |
state = true ) | |
|
|
inline |
The documentation for this class was generated from the following file:
- task_scheduler_observer.h