Repository navigation
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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.89% +0.09%
==========================================
Files 183 184 +1
Lines 7823 7829 +6
Branches 1026 1026
==========================================
+ Hits 6868 6881 +13
+ Misses 704 699 -5
+ Partials 251 249 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 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
There was a problem hiding this comment.
Thanks. Would you prefer that I remove std::call_once and std::once_flag and call ROOT::EnableThreadSafety() directly, leaving repeated-call handling to ROOT? The function would still be called from the appropriate initialization path, rather than a hot path.
There was a problem hiding this comment.
Done — thanks for the feedback. Please let me know if you have any further concerns.
…::EnableThreadSafety() to handle repeated calls instead of enforcing one-time initialization in FORM.
##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.