Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::task_scheduler_observer_v3 Class Reference

#include <task_scheduler_observer.h>

Inheritance diagram for tbb::internal::task_scheduler_observer_v3:
Collaboration diagram for tbb::internal::task_scheduler_observer_v3:

Public Member Functions

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 Attributes

observer_proxymy_proxy
 Pointer to the proxy holding this observer. More...
 
atomic< intptr_t > my_busy_count
 Counter preventing the observer from being destroyed while in use by the scheduler. More...
 

Friends

class observer_proxy
 
class observer_list
 
class interface6::task_scheduler_observer
 

Detailed Description

Definition at line 39 of file task_scheduler_observer.h.

Constructor & Destructor Documentation

◆ task_scheduler_observer_v3()

tbb::internal::task_scheduler_observer_v3::task_scheduler_observer_v3 ( )
inline

Construct observer with observation disabled.

Definition at line 64 of file task_scheduler_observer.h.

64 : my_proxy(NULL) { my_busy_count.store<relaxed>(0); }
atomic< intptr_t > my_busy_count
Counter preventing the observer from being destroyed while in use by the scheduler.
No ordering.
Definition: atomic.h:61
observer_proxy * my_proxy
Pointer to the proxy holding this observer.

References my_busy_count, and tbb::relaxed.

◆ ~task_scheduler_observer_v3()

virtual tbb::internal::task_scheduler_observer_v3::~task_scheduler_observer_v3 ( )
inlinevirtual

Destructor automatically switches observation off if it is enabled.

Definition at line 85 of file task_scheduler_observer.h.

85 { if(my_proxy) observe(false);}
void __TBB_EXPORTED_METHOD observe(bool state=true)
Enable or disable observation.
observer_proxy * my_proxy
Pointer to the proxy holding this observer.

References my_proxy, and observe().

Here is the call graph for this function:

Member Function Documentation

◆ is_observing()

bool tbb::internal::task_scheduler_observer_v3::is_observing ( ) const
inline

Returns true if observation is enabled, false otherwise.

Definition at line 61 of file task_scheduler_observer.h.

61 {return my_proxy!=NULL;}
observer_proxy * my_proxy
Pointer to the proxy holding this observer.

References my_proxy.

◆ observe()

void __TBB_EXPORTED_METHOD tbb::internal::task_scheduler_observer_v3::observe ( bool  state = true)

Enable or disable observation.

For local observers the method can be used only when the current thread has the task scheduler initialized or is attached to an arena.

Repeated calls with the same state are no-ops.

Referenced by tbb::interface6::task_scheduler_observer::observe(), and ~task_scheduler_observer_v3().

Here is the caller graph for this function:

◆ on_scheduler_entry()

virtual void tbb::internal::task_scheduler_observer_v3::on_scheduler_entry ( bool  )
inlinevirtual

Entry notification.

Invoked from inside observe(true) call and whenever a worker enters the arena this observer is associated with. 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.

Obsolete semantics. For global observers it is called by a thread before the first steal since observation became enabled.

Definition at line 74 of file task_scheduler_observer.h.

74 {}

◆ on_scheduler_exit()

virtual void tbb::internal::task_scheduler_observer_v3::on_scheduler_exit ( bool  )
inlinevirtual

Exit notification.

Invoked from inside observe(false) call and whenever a worker leaves the arena this observer is associated with.

Obsolete semantics. For global observers it is called by a thread before the first steal since observation became enabled.

Definition at line 82 of file task_scheduler_observer.h.

82 {}

Friends And Related Function Documentation

◆ interface6::task_scheduler_observer

Definition at line 42 of file task_scheduler_observer.h.

◆ observer_list

friend class observer_list
friend

Definition at line 41 of file task_scheduler_observer.h.

◆ observer_proxy

friend class observer_proxy
friend

Definition at line 40 of file task_scheduler_observer.h.

Member Data Documentation

◆ my_busy_count

atomic<intptr_t> tbb::internal::task_scheduler_observer_v3::my_busy_count
private

Counter preventing the observer from being destroyed while in use by the scheduler.

Valid only when observation is on.

Definition at line 50 of file task_scheduler_observer.h.

Referenced by tbb::interface6::task_scheduler_observer::observe(), and task_scheduler_observer_v3().

◆ my_proxy

observer_proxy* tbb::internal::task_scheduler_observer_v3::my_proxy
private

Pointer to the proxy holding this observer.

Observers are proxied by the scheduler to maintain persistent lists of them.

Definition at line 46 of file task_scheduler_observer.h.

Referenced by is_observing(), tbb::interface6::task_scheduler_observer::observe(), tbb::interface6::task_scheduler_observer::~task_scheduler_observer(), and ~task_scheduler_observer_v3().


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

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.