![]() |
aGrUM
0.16.0
|
A wrapper that enables to store data in a way that prevents false cacheline sharing. More...
#include <agrum/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 56 of file threadData.h.
|
inline |
default constructor
Definition at line 63 of file threadData.h.
|
inline |
default constructor
Definition at line 66 of file threadData.h.
|
inline |
copy constructor
Definition at line 69 of file threadData.h.
|
inline |
move constructor
Definition at line 72 of file threadData.h.
|
inline |
|
inline |
copy operator
Definition at line 86 of file threadData.h.
References gum::ThreadData< T_DATA >::data.
|
inline |
move operator
Definition at line 92 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 100 of file threadData.h.
Referenced by gum::ThreadData< T_DATA >::operator=().