17 #ifndef _TBB_governor_H 18 #define _TBB_governor_H 21 #include "../rml/include/rml_tbb.h" 26 #if __TBB_SURVIVE_THREAD_SWITCH 34 class generic_scheduler;
71 static void acquire_resources ();
74 static void release_resources ();
76 static rml::tbb_server* create_rml_server ( rml::tbb_client& );
81 static void auto_terminate(
void*
scheduler);
86 return DefaultNumberOfThreads ? DefaultNumberOfThreads :
90 return DefaultPageSize ? DefaultPageSize :
93 static void one_time_init();
130 uintptr_t v = theTLS.
get();
135 uintptr_t v = theTLS.
get();
136 return v ? tls_scheduler_of(v) : init_scheduler_weak();
140 return tls_scheduler_of( theTLS.
get() );
145 auto_terminate( local_scheduler_if_initialized() );
148 static void print_version_info ();
150 static void initialize_rml_factory ();
152 static bool does_client_join_workers (
const tbb::internal::rml::tbb_client &client);
154 #if __TBB_SURVIVE_THREAD_SWITCH static unsigned DefaultNumberOfThreads
Caches the maximal level of parallelism supported by the hardware.
static generic_scheduler * local_scheduler_if_initialized()
static bool is_rethrow_broken
static generic_scheduler * local_scheduler_weak()
static bool rethrow_exception_broken()
static size_t DefaultPageSize
Caches the size of OS regular memory page.
static unsigned default_num_threads()
static const int automatic
Typedef for number of threads that is automatic.
size_t DefaultSystemPageSize()
Returns OS regular memory page size.
static bool speculation_enabled()
static rml::tbb_factory theRMLServerFactory
static generic_scheduler * local_scheduler()
Obtain the thread-local instance of the TBB scheduler.
Class that supports TBB initialization.
void const char const char int ITT_FORMAT __itt_group_sync s
static bool is_speculation_enabled
The class handles access to the single instance of market, and to TLS to keep scheduler instances...
static size_t default_page_size()
static bool UsePrivateRML
std::size_t stack_size_type
static basic_tls< uintptr_t > theTLS
TLS for scheduler instances associated with individual threads.
static generic_scheduler * tls_scheduler_of(uintptr_t v)
Converts TLS value to the scheduler pointer.
static void terminate_auto_initialized_scheduler()
Undo automatic initialization if necessary; call when a thread exits.
Work stealing task scheduler.
int AvailableHwConcurrency()
Returns maximal parallelism level supported by the current OS configuration.