Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::arena_slot Struct Reference

#include <scheduler_common.h>

Inheritance diagram for tbb::internal::arena_slot:
Collaboration diagram for tbb::internal::arena_slot:

Public Member Functions

void fill_with_canary_pattern (size_t, size_t)
 
void allocate_task_pool (size_t n)
 
void free_task_pool ()
 Deallocate task pool that was allocated by means of allocate_task_pool. More...
 

Additional Inherited Members

- Public Attributes inherited from tbb::internal::padded_base< arena_slot_line1, NFS_MaxLineSize, sizeof(arena_slot_line1) % NFS_MaxLineSize >
char pad [S - R]
 
- Public Attributes inherited from tbb::internal::arena_slot_line1
generic_schedulermy_scheduler
 Scheduler of the thread attached to the slot. More...
 
task **__TBB_atomic task_pool
 
__TBB_atomic size_t head
 Index of the first ready task in the deque. More...
 
- Public Attributes inherited from tbb::internal::padded_base< arena_slot_line2, NFS_MaxLineSize, sizeof(arena_slot_line2) % NFS_MaxLineSize >
char pad [S - R]
 
- Public Attributes inherited from tbb::internal::arena_slot_line2
unsigned hint_for_pop
 Hint provided for operations with the container of starvation-resistant tasks. More...
 
__TBB_atomic size_t tail
 Index of the element following the last ready task in the deque. More...
 
size_t my_task_pool_size
 Capacity of the primary task pool (number of elements - pointers to task). More...
 
task **__TBB_atomic task_pool_ptr
 

Detailed Description

Definition at line 366 of file scheduler_common.h.

Member Function Documentation

◆ allocate_task_pool()

void tbb::internal::arena_slot::allocate_task_pool ( size_t  n)
inline

Definition at line 376 of file scheduler_common.h.

376  {
377  size_t byte_size = ((n * sizeof(task*) + NFS_MaxLineSize - 1) / NFS_MaxLineSize) * NFS_MaxLineSize;
378  my_task_pool_size = byte_size / sizeof(task*);
379  task_pool_ptr = (task**)NFS_Allocate( 1, byte_size, NULL );
380  // No need to clear the fresh deque since valid items are designated by the head and tail members.
381  // But fill it with a canary pattern in the high vigilance debug mode.
383  }
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 * task
void fill_with_canary_pattern(size_t, size_t)
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
Definition: tbb_stddef.h:220
size_t my_task_pool_size
Capacity of the primary task pool (number of elements - pointers to task).
void *__TBB_EXPORTED_FUNC NFS_Allocate(size_t n_element, size_t element_size, void *hint)
Allocate memory on cache/sector line boundary.

References tbb::internal::NFS_Allocate(), and tbb::internal::NFS_MaxLineSize.

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

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

◆ fill_with_canary_pattern()

void tbb::internal::arena_slot::fill_with_canary_pattern ( size_t  ,
size_t   
)
inline

Definition at line 373 of file scheduler_common.h.

373 {}

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

Here is the caller graph for this function:

◆ free_task_pool()

void tbb::internal::arena_slot::free_task_pool ( )
inline

Deallocate task pool that was allocated by means of allocate_task_pool.

Definition at line 386 of file scheduler_common.h.

386  {
387  // TODO: understand the assertion and modify
388  // __TBB_ASSERT( !task_pool /*TODO: == EmptyTaskPool*/, NULL);
389  if( task_pool_ptr ) {
392  task_pool_ptr = NULL;
393  my_task_pool_size = 0;
394  }
395  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
size_t my_task_pool_size
Capacity of the primary task pool (number of elements - pointers to task).
void __TBB_EXPORTED_FUNC NFS_Free(void *)
Free memory allocated by NFS_Allocate.

References __TBB_ASSERT, and tbb::internal::NFS_Free().

Referenced by tbb::internal::arena::free_arena().

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

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

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