Re: [ROOT] Threads and Draw

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 06 2003 - 15:30:43 MEST


Hi Thomas,

When Root is compiled with -DREENTRANT (the default) with the root
installation, gPad IS NOT a global variable. It is a pointer to a function
that is Thread safe (with the relevant Mutex inside).

Could you send us a short example reproducing your problem?

Rene Brun

Thomas Bretz wrote:
> 
> Dear all,
> 
> I have:
> Two TCanvas (c1 and c2)
> 
> I'm filling c1 from thread 1 (c1->cd(); obj->Draw();) and the same in
> thread 2 for a different object and c2.
> 
> In some cases this gives wrong results, becuase gPad (which is set in
> c1->cd() and c2->Ccd()) is global. Because the decision into whih canvas I
> want to draw (cd()) is done at a completely different place in my program
> than calling draw it would need a big effort to use Mutices here.
> 
> Has somebody an idea how I could make this thread-safe?
> 
> Thanks,
> Thomas.



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET