Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Go to the documentation of this file.
25 #include "../rml/include/rml_tbb.h"
29 #if defined(_MSC_VER) && defined(_Wp64)
31 #pragma warning (push)
32 #pragma warning (disable: 4244)
37 class task_group_context;
91 #if __TBB_ENQUEUE_ENFORCED_CONCURRENCY
92 int my_mandatory_num_requested;
96 #if __TBB_TASK_PRIORITY
102 intptr_t my_global_top_priority;
106 intptr_t my_global_bottom_priority;
111 uintptr_t my_global_reload_epoch;
114 struct priority_level_info {
123 int workers_requested;
126 int workers_available;
162 #if __TBB_COUNT_TASK_NODES
165 atomic<intptr_t> my_task_node_count;
169 market (
unsigned workers_soft_limit,
unsigned workers_hard_limit,
size_t stack_size );
180 #if __TBB_TASK_PRIORITY
190 void update_arena_top_priority (
arena& a, intptr_t newPriority );
193 inline void update_global_top_priority ( intptr_t newPriority );
196 inline void reset_global_priority ();
198 inline void advance_global_reload_epoch () {
203 __TBB_ASSERT( (my_priority_levels[my_global_top_priority].workers_requested > 0
204 && !my_priority_levels[my_global_top_priority].arenas.empty())
205 || (my_global_top_priority == my_global_bottom_priority &&
206 my_global_top_priority == normalized_normal_priority), NULL );
281 static
arena*
create_arena (
int num_slots,
int num_reserved_slots,
size_t stack_size );
290 bool release (
bool is_public,
bool blocking_terminate );
292 #if __TBB_ENQUEUE_ENFORCED_CONCURRENCY
293 void enable_mandatory_concurrency_impl (
arena *a );
297 void enable_mandatory_concurrency (
arena *a );
300 void disable_mandatory_concurrency_impl(
arena* a);
303 void mandatory_concurrency_disable (
arena *a );
323 void register_master( ::rml::server::execution_resource_t& rsc_handle ) {
327 my_server->register_master( rsc_handle );
331 void unregister_master( ::rml::server::execution_resource_t& rsc_handle )
const {
332 my_server->unregister_master( rsc_handle );
336 #if __TBB_TASK_GROUP_CONTEXT
342 template <
typename T>
343 bool propagate_task_group_state ( T task_group_context::*mptr_state, task_group_context& src, T new_state );
346 #if __TBB_TASK_PRIORITY
349 bool lower_arena_priority (
arena& a, intptr_t new_priority, uintptr_t old_reload_epoch );
358 bool update_arena_priority (
arena& a, intptr_t new_priority );
361 #if __TBB_COUNT_TASK_NODES
364 void update_task_node_count( intptr_t delta ) { my_task_node_count += delta; }
367 #if __TBB_TASK_GROUP_CONTEXT
386 #if defined(_MSC_VER) && defined(_Wp64)
388 #pragma warning (pop)
389 #endif // warning 4244 is back
void acknowledge_close_connection() __TBB_override
static global_market_mutex_type theMarketMutex
Mutex guarding creation/destruction of theMarket, insertions/deletions in my_arenas,...
T __TBB_load_with_acquire(const volatile T &location)
void destroy()
Destroys and deallocates market object created by market::create()
void remove_arena_from_list(arena &a)
Used to form groups of tasks.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
atomic< unsigned > my_first_unused_worker_idx
First unused index of worker.
spin_rw_mutex arenas_list_mutex_type
Lightweight mutex guarding accounting operations with arenas list.
uintptr_t my_arenas_aba_epoch
ABA prevention marker to assign to newly created arenas.
scheduler_mutex_type global_market_mutex_type
size_t worker_stack_size() const
Returns the requested stack size of worker threads.
static market & global_market(bool is_public, unsigned max_num_workers=0, size_t stack_size=0)
Factory method creating new market object.
Work stealing task scheduler.
The scoped locking pattern.
unsigned my_workers_soft_limit_to_report
Either workers soft limit to be reported via runtime_warning() or skip_soft_limit_warning.
unsigned my_ref_count
Reference count controlling market object lifetime.
static const unsigned skip_soft_limit_warning
The value indicating that the soft limit warning is unnecessary.
int my_num_workers_requested
Number of workers currently requested from RML.
policy_type policy() const __TBB_override
version_type version() const __TBB_override
intrusive_list< generic_scheduler > scheduler_list_type
unsigned max_job_count() const __TBB_override
arena * my_next_arena
The first arena to be checked when idle worker seeks for an arena to enter.
intrusive_list< arena > arena_list_type
arenas_list_mutex_type my_arenas_list_mutex
job * create_one_job() __TBB_override
bool release(bool is_public, bool blocking_terminate)
Decrements market's refcount and destroys it in the end.
unsigned my_num_workers_soft_limit
Current application-imposed limit on the number of workers (see set_active_num_workers())
static unsigned app_parallelism_limit()
Reports active parallelism level according to user's settings.
void __TBB_store_with_release(volatile T &location, V value)
bool my_join_workers
Shutdown mode.
void update_allotment(unsigned effective_soft_limit)
Recalculates the number of workers assigned to each arena in the list.
unsigned my_num_workers_hard_limit
Maximal number of workers allowed for use by the underlying resource manager.
void detach_arena(arena &)
Removes the arena from the market's list.
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void * lock
static market * theMarket
Currently active global market.
void assert_market_valid() const
friend class generic_scheduler
unsigned my_public_ref_count
Count of master threads attached.
rml::tbb_server * my_server
Pointer to the RML server object that services this TBB instance.
bool is_arena_in_list(arena_list_type &arenas, arena *a)
bool must_join_workers() const
Used when RML asks for join mode during workers termination.
Base class for types that should not be copied or assigned.
size_t my_stack_size
Stack size of worker threads.
int update_workers_request()
Recalculates the number of workers requested from RML and updates the allotment.
market(unsigned workers_soft_limit, unsigned workers_hard_limit, size_t stack_size)
Constructor.
Fast, unfair, spinning reader-writer lock with backoff and writer-preference.
void insert_arena_into_list(arena &a)
int my_total_demand
Number of workers that were requested by all arenas.
static const intptr_t num_priority_levels
atomic< T > & as_atomic(T &t)
void adjust_demand(arena &, int delta)
Request that arena's need in workers should be adjusted.
static unsigned max_num_workers()
static arena * create_arena(int num_slots, int num_reserved_slots, size_t stack_size)
Creates an arena object.
void process(job &j) __TBB_override
A scheduler with a customized evaluation loop.
__TBB_SCHEDULER_MUTEX_TYPE scheduler_mutex_type
Mutex type for global locks in the scheduler.
arena_list_type my_arenas
List of registered arenas.
size_t min_stack_size() const __TBB_override
static void set_active_num_workers(unsigned w)
Set number of active workers.
void cleanup(job &j) __TBB_override
void try_destroy_arena(arena *, uintptr_t aba_epoch)
Removes the arena from the market's list.
friend void ITT_DoUnsafeOneTimeInitialization()
arena * arena_in_need(arena *prev_arena)
Returns next arena that needs more workers, or NULL.
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.