Introduction. I have written a presort c++ analysis library to our triggerless data-acquisition system (600+ channels). I would like to also use optionally Root histograms and trees there. The natural way to increase the throughput is to use a pipeline scheme. I’m using currently taskflow library. In that, there are many worker threads accessing the same resources but of course synchronizing the threads perfectly in between. So no two threads accessing the same resources at same time.
Question. Are the Root histograms and tree thread safe so that I can access those from fully synchronized different threads at different times i.e. with using mutexes or similar. I have to ask this since the Root object seem to have complicated states and they interact with other global objects behind the scenes. The question can be asked also differently: Are histograms or Tree having a thread local data?
Of course, I will create the histograms and trees in one thread before going to parallel pipeline and save histograms to root file after the execution of pipeline in one single thread. Filling copies of histograms and merging them afterwards is not working solution here due to long time correlations (i.e. data must be handled in time order).