Drawing on canvases is still not thread-safe in ROOT 6?

I’ve tried to speed up drawing of ton of histograms with ROOT::Experimental::Async (it works in compiled scripts, not in “interpreted”) and got segfautls.
I’m creating TCanvas objects on the stack, but it, of course, touches some global variables (how else the histogram would know where to Draw() itself).
And looks like this global state is not thread-local…

Hi Berserker,

the fact that ROOT::Async does not work in interpreted code is a surprise: what version are you using on what platform? This was a problem before the last upgrade of llvm. The issue was linked to the treatment of local storage in jitted code.

Pinging @couet about the graphics issue.

Cheers,
D

Yes a canvas is needed to Draw an histogram (or anything). How about creating plot in batch mode generating PDF or PNG ? … well a canvas is needed as well here …

@dpiparo the ticket for the async issue is already here: https://sft.its.cern.ch/jira/browse/ROOT-9277

@couet I run ROOT in batch mode (root -b), I invoke a function, which creates TCanvas object on stack. Then it draws some histograms and calls TCanvas::Print. I will recheck, but it seems that I got segfaults just because I’ve tried to run this functions inside async, with implicit MT with more than 1 thread enabled.

Yes I am afraid TCanvas is not thread safe. Within a thread it is possible to open several canvases though,

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