BioDynaMo  v1.05.120-25dc9790
Classes | Namespaces | Variables
shared_data.h File Reference
#include <array>
#include <cstdint>
#include <new>
#include <vector>
#include "core/util/root.h"
Include dependency graph for shared_data.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  bdm::SharedData< T >
 The SharedData class avoids false sharing between threads. More...
 
struct  bdm::SharedData< T >::AlignedT
 Wrapper for a chacheline-size aligned T. More...
 
struct  bdm::SharedData< T >::Iterator
 

Namespaces

 bdm
 

Variables

constexpr std::size_t hardware_constructive_interference_size = 64u
 
constexpr std::size_t hardware_destructive_interference_size = 64u
 

Variable Documentation

◆ hardware_constructive_interference_size

constexpr std::size_t hardware_constructive_interference_size = 64u
constexpr

This is BioDynaMo's cacheline size. If you system has a different cacheline size, consider changing the value accordingly. In particular, this value is used to align the data in the SharedData class to avoid false sharing between threads. From C++17 on, the standard library provides hardware_constructive_interference_size and hardware_destructive_interference_size, which can be used instead of this constant. If the standard library does not provide these constants, the default value for x86-64 is used.

Definition at line 40 of file shared_data.h.

◆ hardware_destructive_interference_size

constexpr std::size_t hardware_destructive_interference_size = 64u
constexpr

Definition at line 41 of file shared_data.h.