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_scheduler * | my_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
| Task pool of the scheduler that owns this slot. More...

## Detailed Description

Definition at line 377 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 387 of file scheduler_common.h.

{
size_t byte_size = ((n * sizeof(task*) + NFS_MaxLineSize - 1) / NFS_MaxLineSize) * NFS_MaxLineSize;
my_task_pool_size = byte_size / sizeof(task*);
task_pool_ptr = (task**)NFS_Allocate( 1, byte_size, NULL );
// No need to clear the fresh deque since valid items are designated by the head and tail members.
// But fill it with a canary pattern in the high vigilance debug mode.
fill_with_canary_pattern( 0, my_task_pool_size );
}

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 384 of file scheduler_common.h.

{}

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 397 of file scheduler_common.h.

{
// TODO: understand the assertion and modify
// __TBB_ASSERT( !task_pool /*TODO: == EmptyTaskPool*/, NULL);
if( task_pool_ptr ) {
__TBB_ASSERT( my_task_pool_size, NULL);
NFS_Free( task_pool_ptr );
task_pool_ptr = NULL;
my_task_pool_size = 0;
}
}

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:

- scheduler_common.h

__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::internal::arena_slot_line2::task_pool_ptr
task **__TBB_atomic task_pool_ptr
Task pool of the scheduler that owns this slot.
Definition: scheduler_common.h:369
tbb::internal::arena_slot_line2::my_task_pool_size
size_t my_task_pool_size
Capacity of the primary task pool (number of elements - pointers to task).
Definition: scheduler_common.h:366
tbb::internal::arena_slot::fill_with_canary_pattern
void fill_with_canary_pattern(size_t, size_t)
Definition: scheduler_common.h:384
tbb::internal::NFS_MaxLineSize
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
Definition: tbb_stddef.h:216
task
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
Definition: ittnotify_static.h:119
tbb::internal::NFS_Free
void __TBB_EXPORTED_FUNC NFS_Free(void *)
Free memory allocated by NFS_Allocate.
Definition: cache_aligned_allocator.cpp:198
tbb::internal::NFS_Allocate
void *__TBB_EXPORTED_FUNC NFS_Allocate(size_t n_element, size_t element_size, void *hint)
Allocate memory on cache/sector line boundary.
Definition: cache_aligned_allocator.cpp:176

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.