24#ifndef CONTAINER_ARRAY_ATOMICS_INDEX_INTERLEAVED
25#define CONTAINER_ARRAY_ATOMICS_INDEX_INTERLEAVED
72 using type = std::atomic<T>;
122 m_pages{
std::max(static_cast<size_t>(1),
123 (size + m_page_size - 1) / m_page_size)} {
134 return (((index % this->m_pages) * this->m_page_size) +
135 (index / this->m_pages)) *
Indexing provider that interleaves sequentially stored array elements in order to keep them from bein...
Definition: atomics_array_index_interleaved.h:70
size_t m_page_size
The number of array elements that fit a cache line.
Definition: atomics_array_index_interleaved.h:111
Interleaved_indexing(size_t max_size)
Constructor for the class that takes the number of elements in the array.
Definition: atomics_array_index_interleaved.h:118
size_t translate(size_t index) const
Translates the element index to the byte position in the array.
Definition: atomics_array_index_interleaved.h:133
size_t m_size
The array size.
Definition: atomics_array_index_interleaved.h:107
size_t m_cacheline_size
The size of the CPU cache line.
Definition: atomics_array_index_interleaved.h:109
size_t m_pages
The number of cache lines that fit in the byte array.
Definition: atomics_array_index_interleaved.h:113
static size_t element_size()
The array element size, in bytes.
Definition: atomics_array_index_interleaved.h:140
std::atomic< T > type
Definition: atomics_array_index_interleaved.h:72
virtual ~Interleaved_indexing()=default
Class destructor.
size_t size() const
The size of the array.
Definition: atomics_array_index_interleaved.h:128
Definition: atomics_array.h:39
Definition: aligned_atomic.h:44
static size_t minimum_cacheline_for()
Retrieves the amount of bytes, multiple of the current cacheline size, needed to store an element of ...
Definition: aligned_atomic.h:134
Definition: gcs_xcom_synode.h:64