dispenso
A library for task parallelism
 
Loading...
Searching...
No Matches
dispenso::ConcurrentObjectArena< T, Index, alignment > Struct Template Reference

#include <concurrent_object_arena.h>

Public Member Functions

 ConcurrentObjectArena (const Index minBuffSize)
 
 ConcurrentObjectArena (const ConcurrentObjectArena< T, Index, alignment > &other)
 
 ConcurrentObjectArena (ConcurrentObjectArena< T, Index, alignment > &&other) noexcept
 
ConcurrentObjectArena< T, Index, alignment > & operator= (ConcurrentObjectArena< T, Index, alignment > const &other)
 
ConcurrentObjectArena< T, Index, alignment > & operator= (ConcurrentObjectArena< T, Index, alignment > &&other) noexcept
 

Detailed Description

template<class T, class Index = size_t, size_t alignment = dispenso::kCacheLineSize>
struct dispenso::ConcurrentObjectArena< T, Index, alignment >

ConcurrentObjectArena is an indexed sequence container that allows concurrent insertion to its end. Insertion never invalidates pointers or references to the rest of the elements. As opposet to std::vector, the elements of a ConcurrentObjectArena are not stored contiguously. In memory it is sequence of individually allocated fixed-size arrays, with additional bookkeeping. The size of arrays is always power of two (to optimize indexed access)

   buffers  |<────     bufferSize      ───>|
     ┌─┐    ┌──────────────────────────────┐
     │*├───>│                              │
     ├─┤    ├──────────────────────────────┤
     │*├───>│                              │
     ├─┤    ├──────────────────────────────┤
     │*├───>│                              │
     └─┘    └──────────────────────────────┘
*

Definition at line 56 of file concurrent_object_arena.h.

Constructor & Destructor Documentation

◆ ConcurrentObjectArena() [1/3]

template<class T , class Index = size_t, size_t alignment = dispenso::kCacheLineSize>
dispenso::ConcurrentObjectArena< T, Index, alignment >::ConcurrentObjectArena ( const Index  minBuffSize)
inlineexplicit

Construct a ConcurrentObjectArena with given or bigger contiguous array size

Parameters
minBuffSizeThe minimum size of the internal buffer. If given size is not power of 2 the closest bigger power of two would be chosen.

Definition at line 64 of file concurrent_object_arena.h.

◆ ConcurrentObjectArena() [2/3]

template<class T , class Index = size_t, size_t alignment = dispenso::kCacheLineSize>
dispenso::ConcurrentObjectArena< T, Index, alignment >::ConcurrentObjectArena ( const ConcurrentObjectArena< T, Index, alignment > &  other)
inline

Copy constructor

Definition at line 82 of file concurrent_object_arena.h.

◆ ConcurrentObjectArena() [3/3]

template<class T , class Index = size_t, size_t alignment = dispenso::kCacheLineSize>
dispenso::ConcurrentObjectArena< T, Index, alignment >::ConcurrentObjectArena ( ConcurrentObjectArena< T, Index, alignment > &&  other)
inlinenoexcept

Move constructor

Definition at line 107 of file concurrent_object_arena.h.

◆ ~ConcurrentObjectArena()

template<class T , class Index = size_t, size_t alignment = dispenso::kCacheLineSize>
dispenso::ConcurrentObjectArena< T, Index, alignment >::~ConcurrentObjectArena ( )
inline

Definition at line 119 of file concurrent_object_arena.h.

Member Function Documentation

◆ operator=() [1/2]

template<class T , class Index = size_t, size_t alignment = dispenso::kCacheLineSize>
ConcurrentObjectArena< T, Index, alignment > & dispenso::ConcurrentObjectArena< T, Index, alignment >::operator= ( ConcurrentObjectArena< T, Index, alignment > &&  other)
inlinenoexcept

Move assignment operator. This is not concurrency safe.

Definition at line 144 of file concurrent_object_arena.h.

◆ operator=() [2/2]

template<class T , class Index = size_t, size_t alignment = dispenso::kCacheLineSize>
ConcurrentObjectArena< T, Index, alignment > & dispenso::ConcurrentObjectArena< T, Index, alignment >::operator= ( ConcurrentObjectArena< T, Index, alignment > const other)
inline

Copy assignment operator. This is not concurrency safe.

Definition at line 134 of file concurrent_object_arena.h.


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