|
dispenso 1.4.1
A library for task parallelism
|
#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 | |
| Index | grow_by (const Index delta) |
| Index | size () const |
| Index | capacity () const |
| Index | numBuffers () const |
| const T * | getBuffer (const Index index) const |
| T * | getBuffer (const Index index) |
| Index | getBufferSize (const Index index) const |
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 57 of file concurrent_object_arena.h.
|
inlineexplicit |
Construct a ConcurrentObjectArena with given or bigger contiguous array size
| minBuffSize | The 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 65 of file concurrent_object_arena.h.
|
inline |
Copy constructor
Definition at line 83 of file concurrent_object_arena.h.
|
inlinenoexcept |
Move constructor
Definition at line 108 of file concurrent_object_arena.h.
|
inline |
Definition at line 120 of file concurrent_object_arena.h.
|
inline |
The current capacity of the object arena. Concurrency safe.
Definition at line 226 of file concurrent_object_arena.h.
|
inline |
Get the pointer to the buffer. Concurrency safe.
| index | index of the buffer |
Definition at line 252 of file concurrent_object_arena.h.
|
inline |
Get the pointer to the buffer. Concurrency safe.
| index | index of the buffer |
Definition at line 243 of file concurrent_object_arena.h.
|
inline |
Get the used buffer size. not concurrency safe.
| index | index of the buffer. |
Definition at line 261 of file concurrent_object_arena.h.
|
inline |
Grow a container
This function is thread safe and never invalidates pointers or references to the rest of the elements. It is lock-free if new elements can be placed in current buffer. It locks if it allocates a new buffer.
| delta | New size of the container will be delta elements bigger. |
Definition at line 159 of file concurrent_object_arena.h.
|
inline |
Number of the internal buffers. Concurrency safe.
Definition at line 234 of file concurrent_object_arena.h.
|
inline |
Get the size of the object arena. Concurrency safe.
Definition at line 218 of file concurrent_object_arena.h.