Skip to content

Threading fix of TRT MultChanContainer: Initialize cache in initialize()...

Walter Lampl requested to merge wlampl/athena:TRTCond_threadingFix into master

The TRTCond::MultChanContainer uses a internal cache to speed up the COOL-channel lookup. Up to now, this cache was filled lazily on the the first invocation of the MultChanContainer::getContainer(size_t chanid) method. This leads to threading problems. I did observe a crash in one of my tests with 12 threads.

The underlying AthenaPoolUtilities/CondMultChanCollection class has an initialize()-hook that gets called by the POOL converter when one of these objects are loaded from the POOL conditions file. With the update proposed here, the cache gets filled in this method. So the MultChanContainer::getContainer method can be truly const w/o mutable-cheating.

Note to the TRT Conditions experts (I hope there is at least one left): This may break the filling of the relevant conditions data (RtRelation, StawDx, StawStatus, StrawT0). I suspect it's ok because there is a non-const method doing the same (called findContainer).

Tagging @hansenph

Merge request reports

Loading