tbb::internal::governor Class Reference

The class handles access to the single instance of market, and to TLS to keep scheduler instances. More...

`#include <governor.h>`

Collaboration diagram for tbb::internal::governor:

## Static Public Member Functions

static unsigned | default_num_threads ()
static size_t | default_page_size ()
static void | one_time_init ()
static generic_scheduler * | init_scheduler (int num_threads, stack_size_type stack_size, bool auto_init)
| Processes scheduler initialization request (possibly nested) in a master thread. More...
static generic_scheduler * | init_scheduler_weak ()
| Automatic initialization of scheduler in a master thread with default settings without arena. More...
static bool | terminate_scheduler (generic_scheduler *s, bool blocking)
| Processes scheduler termination request (possibly nested) in a master thread. More...
static void | sign_on (generic_scheduler *s)
| Register TBB scheduler instance in thread-local storage. More...
static void | sign_off (generic_scheduler *s)
| Unregister TBB scheduler instance from thread-local storage. More...
static bool | is_set (generic_scheduler *s)
| Used to check validity of the local scheduler TLS contents. More...
static void | assume_scheduler (generic_scheduler *s)
| Temporarily set TLS slot to the given scheduler. More...
static uintptr_t | tls_value_of (generic_scheduler *s)
| Computes the value of the TLS. More...
static generic_scheduler * | tls_scheduler_of (uintptr_t v)
| Converts TLS value to the scheduler pointer. More...
static generic_scheduler * | local_scheduler ()
| Obtain the thread-local instance of the TBB scheduler. More...
static generic_scheduler * | local_scheduler_weak ()
static generic_scheduler * | local_scheduler_if_initialized ()
static void | terminate_auto_initialized_scheduler ()
| Undo automatic initialization if necessary; call when a thread exits. More...
static void | print_version_info ()
static void | initialize_rml_factory ()
static bool | does_client_join_workers (const tbb::internal::rml::tbb_client &client)
static bool | speculation_enabled ()
static bool | rethrow_exception_broken ()

## Static Private Member Functions

static void | acquire_resources ()
| Create key for thread-local storage and initialize RML. More...
static void | release_resources ()
| Destroy the thread-local storage key and deinitialize RML. More...
static rml::tbb_server * | create_rml_server (rml::tbb_client &)
static void | auto_terminate (void *scheduler)
| The internal routine to undo automatic initialization. More...

## Static Private Attributes

static basic_tls< uintptr_t > | theTLS
| TLS for scheduler instances associated with individual threads. More...
static unsigned | DefaultNumberOfThreads
| Caches the maximal level of parallelism supported by the hardware. More...
static size_t | DefaultPageSize
| Caches the size of OS regular memory page. More...
static rml::tbb_factory | theRMLServerFactory
static bool | UsePrivateRML
static bool | is_speculation_enabled
static bool | is_rethrow_broken

## Friends

class | __TBB_InitOnce
class | market

## Detailed Description

The class handles access to the single instance of market, and to TLS to keep scheduler instances.

It also supports automatic on-demand initialization of the TBB scheduler. The class contains only static data members and methods.

Definition at line 48 of file governor.h.

## Member Function Documentation

## acquire_resources()

void tbb::internal::governor::acquire_resources | ( |  | ) |

static private

Create key for thread-local storage and initialize RML.

Definition at line 67 of file governor.cpp.

{
#if USE_PTHREAD
int status = theTLS.create(auto_terminate);
#else
int status = theTLS.create();
#endif
if( status )
handle_perror(status, "TBB failed to initialize task scheduler TLS\n");
is_speculation_enabled = cpu_has_speculation();
is_rethrow_broken = gcc_rethrow_exception_broken();
}

References auto_terminate(), tbb::internal::cpu_has_speculation(), tbb::internal::basic_tls< T >::create(), tbb::internal::gcc_rethrow_exception_broken(), tbb::internal::handle_perror(), is_rethrow_broken, is_speculation_enabled, and theTLS.

Referenced by tbb::internal::__TBB_InitOnce::add_ref().

Here is the call graph for this function:
Here is the caller graph for this function:

## assume_scheduler()

void tbb::internal::governor::assume_scheduler | ( | generic_scheduler * | s | ) |

static

Temporarily set TLS slot to the given scheduler.

Definition at line 116 of file governor.cpp.

{
theTLS.set( tls_value_of(s) );
}

References s, tbb::internal::basic_tls< T >::set(), theTLS, and tls_value_of().

Referenced by auto_terminate(), tbb::internal::market::cleanup(), init_scheduler(), tbb::internal::generic_scheduler::nested_arena_entry(), sign_off(), sign_on(), and tbb::internal::nested_arena_context::~nested_arena_context().

Here is the call graph for this function:
Here is the caller graph for this function:

## auto_terminate()

void tbb::internal::governor::auto_terminate | ( | void * | scheduler | ) |

static private

The internal routine to undo automatic initialization.

The signature is written with void* so that the routine can be the destructor argument to pthread_key_create.

Definition at line 215 of file governor.cpp.

{
generic_scheduler* s = tls_scheduler_of( uintptr_t(arg) ); // arg is equivalent to theTLS.get()
if( s && s->my_auto_initialized ) {
if( !--(s->my_ref_count) ) {
// If the TLS slot is already cleared by OS or underlying concurrency
// runtime, restore its value.
if( !is_set(s) )
assume_scheduler(s);
s->cleanup_master( /*blocking_terminate=*/false );
__TBB_ASSERT( is_set(NULL), "cleanup_master has not cleared its TLS slot" );
}
}
}

References __TBB_ASSERT, assume_scheduler(), is_set(), s, and tls_scheduler_of().

Referenced by acquire_resources(), and terminate_auto_initialized_scheduler().

Here is the call graph for this function:
Here is the caller graph for this function:

## create_rml_server()

rml::tbb_server * tbb::internal::governor::create_rml_server | ( | rml::tbb_client & | client | ) |

static private

Definition at line 92 of file governor.cpp.

{
rml::tbb_server* server = NULL;
if( !UsePrivateRML ) {
::rml::factory::status_type status = theRMLServerFactory.make_server( server, client );
if( status != ::rml::factory::st_success ) {
UsePrivateRML = true;
runtime_warning( "rml::tbb_factory::make_server failed with status %x, falling back on private rml", status );
}
}
if ( !server ) {
__TBB_ASSERT( UsePrivateRML, NULL );
server = rml::make_private_server( client );
}
__TBB_ASSERT( server, "Failed to create RML server" );
return server;
}

References __TBB_ASSERT, tbb::internal::rml::make_private_server(), tbb::internal::runtime_warning(), theRMLServerFactory, and UsePrivateRML.

Referenced by tbb::internal::market::market().

Here is the call graph for this function:
Here is the caller graph for this function:

## default_num_threads()

static unsigned tbb::internal::governor::default_num_threads | ( |  | ) |

inline static

Definition at line 84 of file governor.h.

{
// No memory fence required, because at worst each invoking thread calls AvailableHwConcurrency once.
return DefaultNumberOfThreads ? DefaultNumberOfThreads :
DefaultNumberOfThreads = AvailableHwConcurrency();
}

References tbb::internal::AvailableHwConcurrency(), and DefaultNumberOfThreads.

Referenced by tbb::internal::calc_workers_soft_limit(), tbb::internal::rml::private_server::default_concurrency(), tbb::task_scheduler_init::default_num_threads(), tbb::internal::allowed_parallelism_control::default_value(), tbb::internal::DoOneTimeInitializations(), tbb::internal::market::global_market(), tbb::internal::tbb_thread_v3::hardware_concurrency(), and init_scheduler().

Here is the call graph for this function:
Here is the caller graph for this function:

## default_page_size()

static size_t tbb::internal::governor::default_page_size | ( |  | ) |

inline static

Definition at line 89 of file governor.h.

{
return DefaultPageSize ? DefaultPageSize :
DefaultPageSize = DefaultSystemPageSize();
}

References DefaultPageSize, and tbb::internal::DefaultSystemPageSize().

Referenced by tbb::internal::create_coroutine(), tbb::internal::destroy_coroutine(), and tbb::internal::DoOneTimeInitializations().

Here is the call graph for this function:
Here is the caller graph for this function:

## does_client_join_workers()

bool tbb::internal::governor::does_client_join_workers | ( | const tbb::internal::rml::tbb_client & | client | ) |

static

Definition at line 304 of file market.cpp.

{
return ((const market&)client).must_join_workers();
}

Referenced by tbb::internal::rml::private_worker::start_shutdown(), and tbb::internal::rml::private_worker::wake_or_launch().

Here is the caller graph for this function:

## init_scheduler()

generic_scheduler * tbb::internal::governor::init_scheduler | ( | int | num_threads,
|  | stack_size_type | stack_size,
|  | bool | auto_init
| ) |  |

static

Processes scheduler initialization request (possibly nested) in a master thread.

If necessary creates new instance of arena and/or local scheduler. The auto_init argument specifies if the call is due to automatic initialization.

Definition at line 172 of file governor.cpp.

{
one_time_init();
if ( uintptr_t v = theTLS.get() ) {
generic_scheduler* s = tls_scheduler_of( v );
if ( (v&1) == 0 ) { // TLS holds scheduler instance without arena
__TBB_ASSERT( s->my_ref_count == 1, "weakly initialized scheduler must have refcount equal to 1" );
__TBB_ASSERT( !s->my_arena, "weakly initialized scheduler must have no arena" );
__TBB_ASSERT( s->my_auto_initialized, "weakly initialized scheduler is supposed to be auto-initialized" );
s->attach_arena( market::create_arena( default_num_threads(), 1, 0 ), 0, /*is_master*/true );
__TBB_ASSERT( s->my_arena_index == 0, "Master thread must occupy the first slot in its arena" );
s->my_arena_slot->my_scheduler = s;
#if __TBB_TASK_GROUP_CONTEXT
s->my_arena->my_default_ctx = s->default_context(); // it also transfers implied ownership
#endif
// Mark the scheduler as fully initialized
assume_scheduler( s );
}
// Increment refcount only for explicit instances of task_scheduler_init.
if ( !auto_init ) s->my_ref_count += 1;
__TBB_ASSERT( s->my_arena, "scheduler is not initialized fully" );
return s;
}
// Create new scheduler instance with arena
if( num_threads == task_scheduler_init::automatic )
num_threads = default_num_threads();
arena *a = market::create_arena( num_threads, 1, stack_size );
generic_scheduler* s = generic_scheduler::create_master( a );
__TBB_ASSERT(s, "Somehow a local scheduler creation for a master thread failed");
__TBB_ASSERT( is_set(s), NULL );
s->my_auto_initialized = auto_init;
return s;
}

References __TBB_ASSERT, assume_scheduler(), tbb::task_scheduler_init::automatic, tbb::internal::market::create_arena(), tbb::internal::generic_scheduler::create_master(), default_num_threads(), tbb::internal::basic_tls< T >::get(), is_set(), one_time_init(), s, theTLS, and tls_scheduler_of().

Referenced by tbb::task_scheduler_init::initialize(), and local_scheduler().

Here is the call graph for this function:
Here is the caller graph for this function:

## init_scheduler_weak()

generic_scheduler * tbb::internal::governor::init_scheduler_weak | ( |  | ) |

static

Automatic initialization of scheduler in a master thread with default settings without arena.

Definition at line 164 of file governor.cpp.

{
one_time_init();
__TBB_ASSERT( is_set(NULL), "TLS contains a scheduler?" );
generic_scheduler* s = generic_scheduler::create_master( NULL ); // without arena
s->my_auto_initialized = true;
return s;
}

References __TBB_ASSERT, tbb::internal::generic_scheduler::create_master(), is_set(), one_time_init(), and s.

Referenced by local_scheduler_weak().

Here is the call graph for this function:
Here is the caller graph for this function:

## initialize_rml_factory()

void tbb::internal::governor::initialize_rml_factory | ( |  | ) |

static

Definition at line 242 of file governor.cpp.

{
::rml::factory::status_type res = theRMLServerFactory.open();
UsePrivateRML = res != ::rml::factory::st_success;
}

References theRMLServerFactory, and UsePrivateRML.

Referenced by tbb::internal::DoOneTimeInitializations().

Here is the caller graph for this function:

## is_set()

bool tbb::internal::governor::is_set | ( | generic_scheduler * | s | ) |

static

Used to check validity of the local scheduler TLS contents.

Definition at line 120 of file governor.cpp.

{
return theTLS.get() == tls_value_of(s);
}

References tbb::internal::basic_tls< T >::get(), s, theTLS, and tls_value_of().

Referenced by auto_terminate(), tbb::internal::generic_scheduler::cleanup_master(), tbb::internal::generic_scheduler::generic_scheduler(), init_scheduler(), init_scheduler_weak(), tbb::internal::generic_scheduler::local_spawn(), tbb::internal::generic_scheduler::local_spawn_root_and_wait(), tbb::internal::custom_scheduler< SchedulerTraits >::local_wait_for_all(), tbb::internal::market::process(), tbb::internal::arena::process(), sign_off(), sign_on(), and terminate_scheduler().

Here is the call graph for this function:
Here is the caller graph for this function:

## local_scheduler()

static generic_scheduler* tbb::internal::governor::local_scheduler | ( |  | ) |

inline static

Obtain the thread-local instance of the TBB scheduler.

If the scheduler has not been initialized yet, initialization is done automatically. Note that auto-initialized scheduler instance is destroyed only when its thread terminates.

Definition at line 129 of file governor.h.

{
uintptr_t v = theTLS.get();
return (v&1) ? tls_scheduler_of(v) : init_scheduler( task_scheduler_init::automatic, 0, /*auto_init=*/true );
}

References tbb::task_scheduler_init::automatic, tbb::internal::basic_tls< T >::get(), init_scheduler(), theTLS, and tls_scheduler_of().

Referenced by tbb::internal::arena::advertise_new_work(), tbb::internal::generic_scheduler::enqueue(), tbb::internal::get_initial_auto_partitioner_divisor(), tbb::internal::affinity_partitioner_base_v3::resize(), tbb::internal::generic_scheduler::spawn(), tbb::task::spawn_and_wait_for_all(), tbb::internal::generic_scheduler::spawn_root_and_wait(), and tbb::internal::custom_scheduler< SchedulerTraits >::wait_for_all().

Here is the call graph for this function:
Here is the caller graph for this function:

## local_scheduler_if_initialized()

static generic_scheduler* tbb::internal::governor::local_scheduler_if_initialized | ( |  | ) |

inline static

Definition at line 139 of file governor.h.

{
return tls_scheduler_of( theTLS.get() );
}

References tbb::internal::basic_tls< T >::get(), theTLS, and tls_scheduler_of().

Referenced by tbb::internal::market::adjust_demand(), tbb::internal::market::cleanup(), tbb::internal::arena::enqueue_task(), and terminate_auto_initialized_scheduler().

Here is the call graph for this function:
Here is the caller graph for this function:

## local_scheduler_weak()

static generic_scheduler* tbb::internal::governor::local_scheduler_weak | ( |  | ) |

inline static

Definition at line 134 of file governor.h.

{
uintptr_t v = theTLS.get();
return v ? tls_scheduler_of(v) : init_scheduler_weak();
}

References tbb::internal::basic_tls< T >::get(), init_scheduler_weak(), theTLS, and tls_scheduler_of().

Referenced by tbb::internal::allocate_additional_child_of_proxy::allocate(), tbb::internal::allocate_root_proxy::allocate(), tbb::internal::allocate_continuation_proxy::allocate(), tbb::internal::allocate_child_proxy::allocate(), tbb::interface5::internal::task_base::destroy(), tbb::internal::allocate_additional_child_of_proxy::free(), tbb::internal::allocate_root_proxy::free(), tbb::internal::allocate_continuation_proxy::free(), tbb::internal::allocate_child_proxy::free(), and tbb::task::self().

Here is the call graph for this function:
Here is the caller graph for this function:

## one_time_init()

void tbb::internal::governor::one_time_init | ( |  | ) |

static

Definition at line 156 of file governor.cpp.

{
if( !__TBB_InitOnce::initialization_done() )
DoOneTimeInitializations();
#if __TBB_SURVIVE_THREAD_SWITCH
atomic_do_once( &initialize_cilk_interop, cilkrts_load_state );
#endif /* __TBB_SURVIVE_THREAD_SWITCH */
}

References tbb::internal::atomic_do_once(), tbb::internal::DoOneTimeInitializations(), and tbb::internal::__TBB_InitOnce::initialization_done().

Referenced by init_scheduler(), and init_scheduler_weak().

Here is the call graph for this function:
Here is the caller graph for this function:

## print_version_info()

void tbb::internal::governor::print_version_info | ( |  | ) |

static

Definition at line 229 of file governor.cpp.

{
if ( UsePrivateRML )
PrintExtraVersionInfo( "RML", "private" );
else {
PrintExtraVersionInfo( "RML", "shared" );
theRMLServerFactory.call_with_server_info( PrintRMLVersionInfo, (void*)"" );
}
#if __TBB_SURVIVE_THREAD_SWITCH
if( watch_stack_handler )
PrintExtraVersionInfo( "CILK", CILKLIB_NAME );
#endif /* __TBB_SURVIVE_THREAD_SWITCH */
}

References tbb::internal::PrintExtraVersionInfo(), tbb::internal::PrintRMLVersionInfo(), theRMLServerFactory, and UsePrivateRML.

Referenced by tbb::internal::DoOneTimeInitializations().

Here is the call graph for this function:
Here is the caller graph for this function:

## release_resources()

void tbb::internal::governor::release_resources | ( |  | ) |

static private

Destroy the thread-local storage key and deinitialize RML.

Definition at line 79 of file governor.cpp.

{
theRMLServerFactory.close();
destroy_process_mask();
#if TBB_USE_ASSERT
if( __TBB_InitOnce::initialization_done() && theTLS.get() )
runtime_warning( "TBB is unloaded while tbb::task_scheduler_init object is alive?" );
#endif
int status = theTLS.destroy();
if( status )
runtime_warning("failed to destroy task scheduler TLS: %s", strerror(status));
dynamic_unlink_all();
}

References tbb::internal::basic_tls< T >::destroy(), tbb::internal::destroy_process_mask(), dynamic_unlink_all(), tbb::internal::basic_tls< T >::get(), tbb::internal::__TBB_InitOnce::initialization_done(), tbb::internal::runtime_warning(), theRMLServerFactory, and theTLS.

Referenced by tbb::internal::__TBB_InitOnce::remove_ref().

Here is the call graph for this function:
Here is the caller graph for this function:

## rethrow_exception_broken()

static bool tbb::internal::governor::rethrow_exception_broken | ( |  | ) |

inline static

Definition at line 159 of file governor.h.

{ return is_rethrow_broken; }

References is_rethrow_broken.

## sign_off()

void tbb::internal::governor::sign_off | ( | generic_scheduler * | s | ) |

static

Unregister TBB scheduler instance from thread-local storage.

Definition at line 145 of file governor.cpp.

{
suppress_unused_warning(s);
__TBB_ASSERT( is_set(s), "attempt to unregister a wrong scheduler instance" );
assume_scheduler(NULL);
#if __TBB_SURVIVE_THREAD_SWITCH
__cilk_tbb_unwatch_thunk &ut = s->my_cilk_unwatch_thunk;
if ( ut.routine )
(*ut.routine)(ut.data);
#endif /* __TBB_SURVIVE_THREAD_SWITCH */
}

References __TBB_ASSERT, assume_scheduler(), __cilk_tbb_unwatch_thunk::data, is_set(), __cilk_tbb_unwatch_thunk::routine, s, and tbb::internal::suppress_unused_warning().

Referenced by tbb::internal::generic_scheduler::cleanup_scheduler().

Here is the call graph for this function:
Here is the caller graph for this function:

## sign_on()

void tbb::internal::governor::sign_on | ( | generic_scheduler * | s | ) |

static

Register TBB scheduler instance in thread-local storage.

Definition at line 124 of file governor.cpp.

{
__TBB_ASSERT( is_set(NULL) && s, NULL );
assume_scheduler( s );
#if __TBB_SURVIVE_THREAD_SWITCH
if( watch_stack_handler ) {
__cilk_tbb_stack_op_thunk o;
o.routine = &stack_op_handler;
o.data = s;
if( (*watch_stack_handler)(&s->my_cilk_unwatch_thunk, o) ) {
// Failed to register with cilkrts, make sure we are clean
s->my_cilk_unwatch_thunk.routine = NULL;
}
#if TBB_USE_ASSERT
else
s->my_cilk_state = generic_scheduler::cs_running;
#endif /* TBB_USE_ASSERT */
}
#endif /* __TBB_SURVIVE_THREAD_SWITCH */
__TBB_ASSERT( is_set(s), NULL );
}

References __TBB_ASSERT, assume_scheduler(), __cilk_tbb_stack_op_thunk::data, is_set(), __cilk_tbb_stack_op_thunk::routine, and s.

Referenced by tbb::internal::generic_scheduler::create_master(), and tbb::internal::generic_scheduler::create_worker().

Here is the call graph for this function:
Here is the caller graph for this function:

## speculation_enabled()

static bool tbb::internal::governor::speculation_enabled | ( |  | ) |

inline static

Definition at line 158 of file governor.h.

{ return is_speculation_enabled; }

References is_speculation_enabled.

## terminate_auto_initialized_scheduler()

static void tbb::internal::governor::terminate_auto_initialized_scheduler | ( |  | ) |

inline static

Undo automatic initialization if necessary; call when a thread exits.

Definition at line 144 of file governor.h.

{
auto_terminate( local_scheduler_if_initialized() );
}

References auto_terminate(), and local_scheduler_if_initialized().

Referenced by tbb::internal::__TBB_InitOnce::~__TBB_InitOnce().

Here is the call graph for this function:
Here is the caller graph for this function:

## terminate_scheduler()

bool tbb::internal::governor::terminate_scheduler | ( | generic_scheduler * | s,
|  | bool | blocking
| ) |  |

static

Processes scheduler termination request (possibly nested) in a master thread.

Definition at line 205 of file governor.cpp.

{
bool ok = false;
__TBB_ASSERT( is_set(s), "Attempt to terminate non-local scheduler instance" );
if (0 == --(s->my_ref_count)) {
ok = s->cleanup_master( blocking );
__TBB_ASSERT( is_set(NULL), "cleanup_master has not cleared its TLS slot" );
}
return ok;
}

References __TBB_ASSERT, is_set(), and s.

Referenced by tbb::task_scheduler_init::internal_terminate().

Here is the call graph for this function:
Here is the caller graph for this function:

## tls_scheduler_of()

static generic_scheduler* tbb::internal::governor::tls_scheduler_of | ( | uintptr_t | v | ) |

inline static

Converts TLS value to the scheduler pointer.

Definition at line 122 of file governor.h.

{
return (generic_scheduler*)(v & ~uintptr_t(1));
}

Referenced by auto_terminate(), init_scheduler(), local_scheduler(), local_scheduler_if_initialized(), and local_scheduler_weak().

Here is the caller graph for this function:

## tls_value_of()

uintptr_t tbb::internal::governor::tls_value_of | ( | generic_scheduler * | s | ) |

static

Computes the value of the TLS.

Definition at line 110 of file governor.cpp.

{
__TBB_ASSERT( (uintptr_t(s)&1) == 0, "Bad pointer to the scheduler" );
// LSB marks the scheduler initialized with arena
return uintptr_t(s) | uintptr_t((s && (s->my_arena || s->is_worker()))? 1 : 0);
}

References __TBB_ASSERT, and s.

Referenced by assume_scheduler(), and is_set().

Here is the caller graph for this function:

## Friends And Related Function Documentation

## __TBB_InitOnce

friend class __TBB_InitOnce

friend

Definition at line 50 of file governor.h.

## market

friend class market

friend

Definition at line 51 of file governor.h.

## Member Data Documentation

## DefaultNumberOfThreads

unsigned tbb::internal::governor::DefaultNumberOfThreads

static private

Caches the maximal level of parallelism supported by the hardware.

Definition at line 57 of file governor.h.

Referenced by default_num_threads().

## DefaultPageSize

size_t tbb::internal::governor::DefaultPageSize

static private

Caches the size of OS regular memory page.

Definition at line 60 of file governor.h.

Referenced by default_page_size().

## is_rethrow_broken

bool tbb::internal::governor::is_rethrow_broken

static private

Definition at line 68 of file governor.h.

Referenced by acquire_resources(), and rethrow_exception_broken().

## is_speculation_enabled

bool tbb::internal::governor::is_speculation_enabled

static private

Definition at line 67 of file governor.h.

Referenced by acquire_resources(), and speculation_enabled().

## theRMLServerFactory

rml::tbb_factory tbb::internal::governor::theRMLServerFactory

static private

Definition at line 62 of file governor.h.

Referenced by create_rml_server(), initialize_rml_factory(), print_version_info(), and release_resources().

## theTLS

basic_tls< uintptr_t > tbb::internal::governor::theTLS

static private

TLS for scheduler instances associated with individual threads.

Definition at line 54 of file governor.h.

Referenced by acquire_resources(), assume_scheduler(), init_scheduler(), is_set(), local_scheduler(), local_scheduler_if_initialized(), local_scheduler_weak(), and release_resources().

## UsePrivateRML

bool tbb::internal::governor::UsePrivateRML

static private

Definition at line 64 of file governor.h.

Referenced by create_rml_server(), tbb::internal::market::global_market(), initialize_rml_factory(), and print_version_info().

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

- governor.h
- governor.cpp
- market.cpp
- tbb_main.cpp

tbb::internal::basic_tls::get
T get()
Definition: tls.h:57
tbb::internal::governor::theTLS
static basic_tls< uintptr_t > theTLS
TLS for scheduler instances associated with individual threads.
Definition: governor.h:54
tbb::internal::basic_tls::destroy
int destroy()
Definition: tls.h:55
__cilk_tbb_unwatch_thunk
Definition: cilk-tbb-interop.h:95
tbb::internal::basic_tls::create
int create()
Definition: tls.h:48
tbb::internal::governor::DefaultNumberOfThreads
static unsigned DefaultNumberOfThreads
Caches the maximal level of parallelism supported by the hardware.
Definition: governor.h:57
tbb::internal::governor::UsePrivateRML
static bool UsePrivateRML
Definition: governor.h:64
tbb::task_scheduler_init::automatic
static const int automatic
Typedef for number of threads that is automatic.
Definition: task_scheduler_init.h:83
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
__cilk_tbb_stack_op_thunk
Definition: cilk-tbb-interop.h:89
tbb::internal::governor::market
friend class market
Definition: governor.h:51
tbb::internal::handle_perror
void __TBB_EXPORTED_FUNC handle_perror(int error_code, const char *aux_info)
Throws std::runtime_error with what() returning error_code description prefixed with aux_info.
Definition: tbb_misc.cpp:87
__cilk_tbb_stack_op_thunk::data
void * data
Definition: cilk-tbb-interop.h:91
tbb::internal::governor::is_rethrow_broken
static bool is_rethrow_broken
Definition: governor.h:68
tbb::internal::governor::one_time_init
static void one_time_init()
Definition: governor.cpp:156
tbb::internal::governor::tls_value_of
static uintptr_t tls_value_of(generic_scheduler *s)
Computes the value of the TLS.
Definition: governor.cpp:110
tbb::internal::__TBB_InitOnce::initialization_done
static bool initialization_done()
Definition: tbb_main.h:64
tbb::internal::runtime_warning
void __TBB_EXPORTED_FUNC runtime_warning(const char *format,...)
Report a runtime warning.
Definition: tbb_assert_impl.h:85
tbb::internal::DoOneTimeInitializations
void DoOneTimeInitializations()
Performs thread-safe lazy one-time general TBB initialization.
Definition: tbb_main.cpp:215
tbb::internal::cpu_has_speculation
bool cpu_has_speculation()
check for transaction support.
Definition: tbb_misc.cpp:230
tbb::internal::rml::make_private_server
tbb_server * make_private_server(tbb_client &client)
Factory method called from task.cpp to create a private_server.
Definition: private_server.cpp:411
dynamic_unlink_all
void dynamic_unlink_all()
Definition: dynamic_link.cpp:570
tbb::internal::governor::local_scheduler_if_initialized
static generic_scheduler * local_scheduler_if_initialized()
Definition: governor.h:139
tbb::internal::destroy_process_mask
void destroy_process_mask()
Definition: tbb_misc.h:266
tbb::internal::governor::auto_terminate
static void auto_terminate(void *scheduler)
The internal routine to undo automatic initialization.
Definition: governor.cpp:215
tbb::internal::governor::DefaultPageSize
static size_t DefaultPageSize
Caches the size of OS regular memory page.
Definition: governor.h:60
tbb::internal::governor::default_num_threads
static unsigned default_num_threads()
Definition: governor.h:84
tbb::internal::generic_scheduler::create_master
static generic_scheduler * create_master(arena *a)
Initialize a scheduler for a master thread.
Definition: scheduler.cpp:1285
tbb::internal::market::create_arena
static arena * create_arena(int num_slots, int num_reserved_slots, size_t stack_size)
Creates an arena object.
Definition: market.cpp:308
tbb::internal::governor::init_scheduler_weak
static generic_scheduler * init_scheduler_weak()
Automatic initialization of scheduler in a master thread with default settings without arena.
Definition: governor.cpp:164
__cilk_tbb_unwatch_thunk::routine
__cilk_tbb_pfn_unwatch_stacks routine
Definition: cilk-tbb-interop.h:96
tbb::internal::governor::tls_scheduler_of
static generic_scheduler * tls_scheduler_of(uintptr_t v)
Converts TLS value to the scheduler pointer.
Definition: governor.h:122
tbb::internal::gcc_rethrow_exception_broken
bool gcc_rethrow_exception_broken()
Definition: tbb_misc.cpp:198
tbb::internal::governor::theRMLServerFactory
static rml::tbb_factory theRMLServerFactory
Definition: governor.h:62
s
void const char const char int ITT_FORMAT __itt_group_sync s
Definition: ittnotify_static.h:91
tbb::internal::governor::assume_scheduler
static void assume_scheduler(generic_scheduler *s)
Temporarily set TLS slot to the given scheduler.
Definition: governor.cpp:116
tbb::internal::suppress_unused_warning
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
Definition: tbb_stddef.h:398
tbb::internal::governor::is_set
static bool is_set(generic_scheduler *s)
Used to check validity of the local scheduler TLS contents.
Definition: governor.cpp:120
tbb::internal::PrintRMLVersionInfo
void PrintRMLVersionInfo(void *arg, const char *server_info)
A callback routine to print RML version information on stderr.
Definition: tbb_misc.cpp:222
tbb::internal::atomic_do_once
void atomic_do_once(const F &initializer, atomic< do_once_state > &state)
One-time initialization function.
Definition: tbb_misc.h:213
tbb::internal::DefaultSystemPageSize
size_t DefaultSystemPageSize()
Returns OS regular memory page size.
Definition: tbb_misc.cpp:70
tbb::internal::basic_tls::set
void set(T value)
Definition: tls.h:56
__cilk_tbb_stack_op_thunk::routine
__cilk_tbb_pfn_stack_op routine
Definition: cilk-tbb-interop.h:90
tbb::internal::AvailableHwConcurrency
int AvailableHwConcurrency()
Returns maximal parallelism level supported by the current OS configuration.
tbb::internal::governor::is_speculation_enabled
static bool is_speculation_enabled
Definition: governor.h:67
tbb::internal::PrintExtraVersionInfo
void PrintExtraVersionInfo(const char *category, const char *format,...)
Prints arbitrary extra TBB version information on stderr.
Definition: tbb_misc.cpp:211
tbb::internal::governor::init_scheduler
static generic_scheduler * init_scheduler(int num_threads, stack_size_type stack_size, bool auto_init)
Processes scheduler initialization request (possibly nested) in a master thread.
Definition: governor.cpp:172
__cilk_tbb_unwatch_thunk::data
void * data
Definition: cilk-tbb-interop.h:97

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.