Re: [ROOT] Questions on threads under windows

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Wed Jul 28 2004 - 12:17:23 MEST


Hi Martijn,

> Hi rooters,
> 
> Sorry for bothering you once more with this famous threads question: are 
> threads currently supported under windows (2000) with Root.

 - do you mean win32gdk? 

 - do you mean TThread class under win32gdk? If it's so, TThread and co. classes 
     in TODO list. IMO, this class must be rewritten in more general way
    (without special purpose http://root.cern.ch/root/htmldoc/TThread.html#TThread:XAction)

 - you can use Win32 API to create threads inside compiled code.
   There are two classes which provides thread safety under win32gdk
   TInterpereter and TVirtualX.
    For example, at  http://root.cern.ch/root/htmldoc/src/TCanvas.cxx.html#TCanvas:Update
    it's used as 

   if (!gVirtualX->IsCmdThread()) {
      gInterpreter->Execute(this, IsA(), "Update", "");
      return;
   }

> Or is there another way of having functions run in the background of Root. 

 - you can use TTimer class. http://root.cern.ch/root/htmldoc/TTimer.html
   you can connect TTimer::Timeout signal to "worker" function wich would do  
   something in "background"

Regards. Valeriy

> I tried to use the TROOT::ProcessLine() which is supposed to be 
> asynchronous under Windows but it does seem to block my root session 
> whatsoever: what is the definition of asynchronous then?
> 
> Thank you very much,
> 
> Martijn
> 
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET