|
SHiP Geometry Service
Framework-agnostic C++20 library wrapping the SHiP GeoModel geometry behind a stable interface.
|
Runs posted tasks on one dedicated thread until destroyed. More...
#include <GeometryThread.h>
Public Member Functions | |
| ~GeometryThread ()=default | |
| GeometryThread (const GeometryThread &)=delete | |
| GeometryThread & | operator= (const GeometryThread &)=delete |
| GeometryThread (GeometryThread &&)=delete | |
| GeometryThread & | operator= (GeometryThread &&)=delete |
| template<typename F > requires std::invocable<F&> | |
| std::invoke_result_t< F & > | run (F &&f) |
| Run f on the geometry thread and return its result. | |
Friends | |
| GeometryThread & | geometry_thread () |
| The process-wide Geant4 geometry thread, shared by every geometry user (GENIE geometry analyzers, the Geant4 run-manager master) and never torn down (a parked thread at exit is harmless). | |
Runs posted tasks on one dedicated thread until destroyed.
Geant4 MT split-class state (logical/physical volumes, solids) is only valid on the thread that created it, so every creation or mutation of converted geometry must be funnelled through here. Callers block until their task finishes; exceptions propagate. Safe to call from multiple threads concurrently: tasks queue and run one at a time.
|
default |
|
delete |
|
delete |
|
delete |
|
delete |
|
inline |
Run f on the geometry thread and return its result.
Reentrant: a call made from a task already running on the geometry thread executes f inline instead of deadlocking on its own queue slot.
|
friend |
The process-wide Geant4 geometry thread, shared by every geometry user (GENIE geometry analyzers, the Geant4 run-manager master) and never torn down (a parked thread at exit is harmless).
Geant4 MT allows only a single geometry-*creating* thread per process: G4GeomSplitter's slot count is shared across threads while the data array is thread-local, so a second creating thread writes through its still-null array pointer the moment the first thread has grown the shared count (Geant4 bug #2747, verified with the conda Geant4 11.3 build). Defined in the shared library so dlopened plugins all see the same instance.