Skip to content

Made StatEntity more thread safe

Sebastien Ponce requested to merge lhcb/Gaudi:StatEntityThreadSafe into master

Note that it says more. This is because there is a trade-off here between full thread safety and performance. Namely, what I've done is make the counters atomic. So counters are thread safe and will have now the proper value in all cases. But it does not mean that the whole class is thread safe. In particuler querying while updating may not give consistent answers as the update itself is not atomic (several internal counters are updated, all atomic, the the global operation is not). As an example, querying the mean involves dividing the sum counter by the nbcalls counter, and one may have been updated and not yet the other.

However this is felt to be the best compromise to not introduce heavy locks everywhere in the code.

Merge request reports