Geant4
10.02.p02
|
#include "G4THitsCollection.hh"
#include "G4THitsMap.hh"
#include "globals.hh"
#include "G4atomic.hh"
#include "G4Threading.hh"
#include "G4AutoLock.hh"
#include <map>
#include <type_traits>
Go to the source code of this file.
Classes | |
class | G4TAtomicHitsMap< T > |
This is an implementation of G4THitsMap<T> where the underlying type is G4atomic<T>, not just T. A static assert is provided to ensure that T is fundamental. This class should be used in lieu of G4THitsMap<T> when memory is a concern. Atomics are thread-safe and generally faster that mutexes (as long as the STL implementation is lock-free) but the synchronization does not come without a cost. If performance is the primary concern, use G4THitsMap<T> in thread-local instances. More... | |