Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::strict_ppl::internal::concurrent_queue_rep< T > Struct Template Reference

representation of concurrent_queue_base More...

#include <_concurrent_queue_impl.h>

Inheritance diagram for tbb::strict_ppl::internal::concurrent_queue_rep< T >:
Collaboration diagram for tbb::strict_ppl::internal::concurrent_queue_rep< T >:

Public Member Functions

micro_queue< T > & choose (ticket k)
 
- Public Member Functions inherited from tbb::internal::no_copy
 no_copy (const no_copy &)=delete
 
 no_copy ()=default
 

Static Public Member Functions

static size_t index (ticket k)
 Map ticket to an array index. More...
 

Public Attributes

micro_queue< T > array [n_queue]
 
- Public Attributes inherited from tbb::strict_ppl::internal::concurrent_queue_rep_base
atomic< tickethead_counter
 
char pad1 [NFS_MaxLineSize-sizeof(atomic< ticket >)]
 
atomic< tickettail_counter
 
char pad2 [NFS_MaxLineSize-sizeof(atomic< ticket >)]
 
size_t items_per_page
 Always a power of 2. More...
 
size_t item_size
 Size of an item. More...
 
atomic< size_t > n_invalid_entries
 number of invalid entries in the queue More...
 
char pad3 [NFS_MaxLineSize-sizeof(size_t) -sizeof(size_t) -sizeof(atomic< size_t >)]
 

Additional Inherited Members

- Static Public Attributes inherited from tbb::strict_ppl::internal::concurrent_queue_rep_base
static const size_t n_queue = 8
 
- Static Protected Attributes inherited from tbb::strict_ppl::internal::concurrent_queue_rep_base
static const size_t phi = 3
 Approximately n_queue/golden ratio. More...
 

Detailed Description

template<typename T>
struct tbb::strict_ppl::internal::concurrent_queue_rep< T >

representation of concurrent_queue_base

the class inherits from concurrent_queue_rep_base and defines an array of micro_queue<T>'s

Definition at line 61 of file _concurrent_queue_impl.h.

Member Function Documentation

◆ choose()

template<typename T>
micro_queue<T>& tbb::strict_ppl::internal::concurrent_queue_rep< T >::choose ( ticket  k)
inline

Definition at line 409 of file _concurrent_queue_impl.h.

409  {
410  // The formula here approximates LRU in a cache-oblivious way.
411  return array[index(k)];
412  }
static size_t index(ticket k)
Map ticket to an array index.

Referenced by tbb::strict_ppl::internal::concurrent_queue_base_v3< Value >::internal_push(), and tbb::strict_ppl::internal::concurrent_queue_base_v3< Value >::internal_try_pop().

Here is the caller graph for this function:

◆ index()

template<typename T>
static size_t tbb::strict_ppl::internal::concurrent_queue_rep< T >::index ( ticket  k)
inlinestatic

Map ticket to an array index.

Definition at line 405 of file _concurrent_queue_impl.h.

405  {
406  return k*phi%n_queue;
407  }
static const size_t phi
Approximately n_queue/golden ratio.

Referenced by tbb::strict_ppl::internal::concurrent_queue_iterator_base_v3< tbb_remove_cv< Value >::type >::advance(), and tbb::strict_ppl::internal::concurrent_queue_iterator_rep< Value >::get_item().

Here is the caller graph for this function:

Member Data Documentation

◆ array


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

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.