![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
A wrapper that enables to store data in a way that prevents false cacheline sharing. More...
#include <agrum/tools/core/threadData.h>
Public Attributes | |
T_DATA | data |
the data we wish to store without cacheline parallel problem More... | |
Public Member Functions | |
Constructors / Destructors | |
ThreadData (const T_DATA &theData) | |
default constructor More... | |
ThreadData (T_DATA &&theData) | |
default constructor More... | |
ThreadData (const ThreadData< T_DATA > &from) | |
copy constructor More... | |
ThreadData (ThreadData< T_DATA > &&from) | |
move constructor More... | |
~ThreadData () | |
destructor More... | |
Operators | |
ThreadData< T_DATA > & | operator= (const ThreadData< T_DATA > &from) |
copy operator More... | |
ThreadData< T_DATA > & | operator= (ThreadData< T_DATA > &&from) |
move operator More... | |
A wrapper that enables to store data in a way that prevents false cacheline sharing.
When several threads access to some shared containers like vectors, it may be the case that they access some data within these containers that are too close, which results in false sharing of the cacheline. By wrapping the data into a ThreadData, we guarantee that no false sharing can occur.
To create a wrapper data, simply use wrapped_data = ThreadData (data) and To get the data wrapped, use wrapped_data.data;
Definition at line 55 of file threadData.h.
|
inline |
default constructor
Definition at line 62 of file threadData.h.
References gum::ThreadData< T_DATA >::data.
|
inline |
default constructor
Definition at line 65 of file threadData.h.
References gum::ThreadData< T_DATA >::data.
|
inline |
copy constructor
Definition at line 68 of file threadData.h.
References gum::ThreadData< T_DATA >::data.
|
inline |
move constructor
Definition at line 71 of file threadData.h.
References gum::ThreadData< T_DATA >::data.
|
inline |
|
inline |
copy operator
Definition at line 85 of file threadData.h.
References gum::ThreadData< T_DATA >::data.
|
inline |
move operator
Definition at line 91 of file threadData.h.
References gum::ThreadData< T_DATA >::data.
T_DATA gum::ThreadData< T_DATA >::data |
the data we wish to store without cacheline parallel problem
Definition at line 99 of file threadData.h.
Referenced by gum::ThreadData< T_DATA >::operator=(), and gum::ThreadData< T_DATA >::ThreadData().