Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #989 +/- ##
==========================================
+ Coverage 87.79% 87.81% +0.02%
==========================================
Files 183 184 +1
Lines 7823 7830 +7
Branches 1026 1026
==========================================
+ Hits 6868 6876 +8
Misses 704 704
+ Partials 251 250 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
| static std::once_flag enabled; | ||
| std::call_once(enabled, [] { ROOT::EnableThreadSafety(); }); |
There was a problem hiding this comment.
Side note ROOT::EnableThreadSafety() is safe to call multiple time.
There was a problem hiding this comment.
Good point — agreed, ROOT::EnableThreadSafety() is idempotent and safe to call repeatedly ("only the first call does work"). I had that noted locally but left it out of the final commit message.
There was a problem hiding this comment.
I am not sure what you mean to change. The current code work whether ROOT::EnableThreadSafety() is idempotent and is redundant (beside a tad bit of potential performance improvement) since it is idempotent.
There was a problem hiding this comment.
If , ROOT::EnableThreadSafety() is idempotent FORM doesn't need to ensure its only called once, but leave things to ROOT. We just don't want to cal it a billion trillion times
##Summary
Call
ROOT::EnableThreadSafety()exactly once, when FORM constructs its storage layer, before any concurrent event processing starts.Phlex schedules graph nodes on TBB worker threads, so FORM's containers — and any other node touching ROOT — reach ROOT's global
TClassand streamer state concurrently. ROOT does not serialize that state unless thread safety is explicitly enabled.Without the existing workaround in phlex-examples, for example, the reproducer showed intermittent corruption and crashes.
This also relates to the threading work mentioned in #840.
#840 proposes "write-path mutexes that follow the existing read-side mutex pattern". This is a prerequisite for #840, not an alternative, and #840 acceptance criteria should probably say so.
std::call_once-guarded helper that callsROOT::EnableThreadSafety()once.root_storagesource list.