Filling separate ttrees in parallel threads

I have two separate writers which run in parallel. Each writer has its own ttree (with different branches) and fills it (with independent objects) during the execution, which happens in parallel.
When executing my program with two threads I get a reproducible race condition. The segmentation fault happens when both independent writers call the fill()-method of their ttree in different threads.
Do you know what could be the problem and how I could solve it?

do you call ROOT::EnableThreadSafety() at the beginning of your application?


no I did not do that. I tried it now and it works, thanks!

We are aware multi-threading with ROOT could be documented better – working on that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.