Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::numa_binding_observer Class Reference
Inheritance diagram for tbb::internal::numa_binding_observer:
Collaboration diagram for tbb::internal::numa_binding_observer:

Public Member Functions

 numa_binding_observer (task_arena *ta, int numa_id, int num_slots)
 
void on_scheduler_entry (bool) __TBB_override
 Entry notification. More...
 
void on_scheduler_exit (bool) __TBB_override
 Exit notification. More...
 
- Public Member Functions inherited from tbb::interface6::task_scheduler_observer
 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...
 
- 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. More...
 
 task_scheduler_observer_v3 ()
 Construct observer with observation disabled. More...
 
virtual ~task_scheduler_observer_v3 ()
 Destructor automatically switches observation off if it is enabled. More...
 

Private Attributes

int my_numa_node_id
 
numa_affinity_handler numa_handler
 

Detailed Description

Definition at line 264 of file tbbbind.cpp.

Constructor & Destructor Documentation

◆ numa_binding_observer()

tbb::internal::numa_binding_observer::numa_binding_observer ( task_arena ta,
int  numa_id,
int  num_slots 
)
inline

Definition at line 268 of file tbbbind.cpp.

270  , my_numa_node_id(numa_id)
271  , numa_handler(num_slots)
272  {}
numa_affinity_handler numa_handler
Definition: tbbbind.cpp:266
task_scheduler_observer(bool local=false)
Construct local or global observer in inactive state (observation disabled).

Member Function Documentation

◆ on_scheduler_entry()

void tbb::internal::numa_binding_observer::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.

Reimplemented from tbb::internal::task_scheduler_observer_v3.

Definition at line 274 of file tbbbind.cpp.

References tbb::internal::numa_affinity_handler::bind_thread_to_node(), and tbb::this_task_arena::current_thread_index().

274  {
276  }
numa_affinity_handler numa_handler
Definition: tbbbind.cpp:266
void bind_thread_to_node(unsigned slot_num, unsigned numa_node_id)
Definition: tbbbind.cpp:245
int current_thread_index()
Returns the index, aka slot number, of the calling thread in its current arena.
Definition: task_arena.h:479
Here is the call graph for this function:

◆ on_scheduler_exit()

void tbb::internal::numa_binding_observer::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.

Reimplemented from tbb::internal::task_scheduler_observer_v3.

Definition at line 278 of file tbbbind.cpp.

References tbb::this_task_arena::current_thread_index(), and tbb::internal::numa_affinity_handler::restore_previous_affinity_mask().

278  {
280  }
numa_affinity_handler numa_handler
Definition: tbbbind.cpp:266
void restore_previous_affinity_mask(unsigned slot_num)
Definition: tbbbind.cpp:256
int current_thread_index()
Returns the index, aka slot number, of the calling thread in its current arena.
Definition: task_arena.h:479
Here is the call graph for this function:

Member Data Documentation

◆ my_numa_node_id

int tbb::internal::numa_binding_observer::my_numa_node_id
private

Definition at line 265 of file tbbbind.cpp.

◆ numa_handler

numa_affinity_handler tbb::internal::numa_binding_observer::numa_handler
private

Definition at line 266 of file tbbbind.cpp.


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

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