Geant4  10.02.p01
G4TAtomicHitsCollection.hh File Reference
#include "G4VHitsCollection.hh"
#include "G4Allocator.hh"
#include "globals.hh"
#include "G4Threading.hh"
#include "G4AutoLock.hh"
#include "G4atomic.hh"
#include <deque>
#include <type_traits>
+ Include dependency graph for G4TAtomicHitsCollection.hh:

Go to the source code of this file.

Classes

class  G4TAtomicHitsCollection< T >
 This is an implementation of G4THitsCollection<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 G4THitsCollection<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 G4THitsCollection<T> in thread-local instances. More...