Re: Is ROOT thread-safe?

From: Fons Rademakers (rdm@pcsalo.cern.ch)
Date: Sat Nov 14 1998 - 10:53:56 MET


Hi Walid,

   some parts of ROOT are/can be made thread safe. A lot of work
in the graphics part has been done by Victor Perev of Brookhaven. 
To be able to do that he had to wrap the access of some of ROOT's 
globals (like gPad and gCanvas for the current pad and canvas) in 
access functions. This code is in #ifdef's and requires a special 
build of the ROOT libraries. Some other parts are not threadsafe 
(like CINT, X11) and will require global locks. ROOT comes also with
a number of classes Thread, Mutex, Semaphore, Condition variables
that abstract the differences between posix and solaris and win32
thread libraries.

The Win32 version of ROOT runs always in multi-threaded mode. There
are three threads: user input, command processor (CINT), graphics.
That part has been developed by Valery Fine.

So to summarize, ROOT out-of-the box is not directly ready to be
plugged into a fully multi-threaded environment. However, with some
(reasonable) effort the desired results can be achieved.

As always, if you make something work, send us the required code 
changes and we'll add them to the system.



Cheers, Fons.




> From owner-roottalk@hpsalo.cern.ch  Fri Nov 13 19:58:56 1998
> Return-Path: <owner-roottalk@hpsalo.cern.ch>
> Received: from dxmint.cern.ch (dxmint.cern.ch [137.138.26.76])
> 	by pcsalo.cern.ch (8.8.7/8.8.7) with ESMTP id TAA05538
> 	for <rdm@pcsalo.cern.ch>; Fri, 13 Nov 1998 19:58:56 +0100
> Received: from hpsalo.cern.ch (hpsalo.cern.ch [137.138.199.59])
> 	by dxmint.cern.ch (8.8.8/8.8.8) with ESMTP id TAA10793
> 	for <rdm@pcsalo.cern.ch>; Fri, 13 Nov 1998 19:58:56 +0100 (MET)
> Received: from dxmint.cern.ch (dxmint.cern.ch [137.138.26.76]) by hpsalo.cern.ch with ESMTP (8.7.1/8.7.1) id TAA12553 for <rdm@hpsalo.cern.ch>; Fri, 13 Nov 1998 19:58:55 +0100 (MET)
> Received: from hpsalo.cern.ch (hpsalo.cern.ch [137.138.199.59])
> 	by dxmint.cern.ch (8.8.8/8.8.8) with ESMTP id TAA07666;
> 	Fri, 13 Nov 1998 19:54:17 +0100 (MET)
> Received: (from majordom@localhost) by hpsalo.cern.ch (8.7.1/8.7.1) id NAA12508 for roottalk-outgoing; Fri, 13 Nov 1998 13:53:50 -0500 (EST)
> X-Authentication-Warning: hpsalo.cern.ch: majordom set sender to owner-roottalk@root.cern.ch using -f
> Received: from dxmint.cern.ch (dxmint.cern.ch [137.138.26.76]) by hpsalo.cern.ch with ESMTP (8.7.1/8.7.1) id TAA12504 for <roottalk@hpsalo.cern.ch>; Fri, 13 Nov 1998 19:53:49 +0100 (MET)
> Received: from ligo.caltech.edu (ligo.caltech.edu [131.215.2.106])
> 	by dxmint.cern.ch (8.8.8/8.8.8) with ESMTP id TAA08209
> 	for <roottalk@hpsalo.cern.ch>; Fri, 13 Nov 1998 19:53:47 +0100 (MET)
> Received: from acrux (acrux [131.215.115.14])
> 	by ligo.caltech.edu (8.8.8+Sun/8.8.8) with ESMTP id KAA20800
> 	for <roottalk@hpsalo.cern.ch>; Fri, 13 Nov 1998 10:52:38 -0800 (PST)
> Received: from cor by acrux (8.8.8+Sun/SMI-SVR4)
> 	id KAA08309; Fri, 13 Nov 1998 10:52:54 -0800 (PST)
> Received: from ligo.caltech.edu by cor (SMI-8.6/SMI-SVR4)
> 	id KAA19290; Fri, 13 Nov 1998 10:53:42 -0800
> Message-ID: <364C8036.C3D3FD03@ligo.caltech.edu>
> Date: Fri, 13 Nov 1998 10:53:42 -0800
> From: "Walid A. Majid" <wmajid@ligo.caltech.edu>
> Organization: California Institute of Technology
> X-Mailer: Mozilla 4.04 [en] (X11; I; SunOS 5.6 sun4u)
> MIME-Version: 1.0
> To: roottalk <roottalk@hpsalo.cern.ch>
> Subject: Is ROOT thread-safe?
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> Sender: owner-roottalk@hpsalo.cern.ch
> Precedence: bulk
> X-Status: 
> X-Keywords:
> X-UID: 30479
> 
> I was wondering whether ROOT is thread-safe (PThreads in UNIX
> environment).  And if there are any gotchas using ROOT as a server in a
> multi-threaded environment.
> 
> Thanks.
> 
> Walid
> 


-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:39 MET