Threads in ROOT

Hi,

sorry, what do you mean by “just” ??

I have modified it like you said:

github.com/ishvetso/aTGCsAnalys … pp#L49-L87

but it’s still crashing after running for a while… Have I missed something?

Regards,
Ivan.

Hi,

What is the type of hist_? I see that each thread does:hist_ -> Add(temp);which is a concurrent access to what seems to be a collection and is possibly not thread safe on its owns. You may have to add an explicit mutex around this access or use a lock free collection.

Cheers,
Philippe.

Hi Philippe,

I have add mutex around hist -> Add(…), this is has run on smaller tree, but on the larger tree it still crashes.

Regards,
Ivan.

Hi,

What is the stack trace when it crashes? Do you have a complete reproducer we could run?

Philippe.

Hi,

sorry for the late reply. The log of the crash is attached.

In order reproduce the problem you need to checkout my repository:
git clone -b 74X_plots_threading git@github.com:ishvetso/aTGCsAnalysis.git

and you can do (on lxplus):
cd aTGCsAnalysis/Common/test/Plotting
g++ -o draw draw.cpp --std=c++11 root-config --cflags --libs -O2 -I./ -lASImage
./draw ele ttbar

Thanks,
Ivan.
Log.txt (41.8 KB)

Hi Philippe,

are you sure you have picked up branch “74X_plots_threading” ? It should not happen there …

Regards,
Ivan.

yes, I was using the wrong branch.

Hi,

did you manage to reproduce the problem?

Regards,
Ivan.

Hi Ivan,

Yes, I was able to reproduce the problem. It is indeed a problem with the ROOT inner code. I have not yet found a satisfactory work-around.

Cheers,
Philippe.