[root] / trunk / core / thread / src / TThread.cxx Repository:
ViewVC logotype

Log of /trunk/core/thread/src/TThread.cxx

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 48043 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 14 12:20:32 2012 UTC (2 years, 1 month ago) by rdm
File length: 33871 byte(s)
Diff to previous 45617
change gCint -> gCling (and not the generic gInterpreter as we'll stay for a
while with cling ;-) ).

Revision 45617 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 15 16:11:52 2012 UTC (2 years, 5 months ago) by pcanal
File length: 33869 byte(s)
Diff to previous 43098
From Elvin and Philippe:

In TJoinHelper::Join check the predicate value (fJoined) both when the TimedWaited return due to a timeout or due to receiving the signal
and unconditionally breakout in case of errors.

Elvin tracked down the issue. Basically, there is a deadlock in the TJoinHelper::Join method. 

The problem is when the helper thread tries to signal the main thread then the join is done. This is achieved by using the conditional variable fC. But, it can be that the helper thread gets the lock in the TJoinHelper::JoinFunc method around line 117 and the requesting threads tries to wait in line 136 but the time-out expires before the helper thread sends the signal and releases the lock ( one can easily reproduce this by adding a sleep(3) after lline 117). So, now the requesting thread is blocked waiting to get the lock for the mutex. Say now that the helper thread sends the signal and releases the lock. The signal is lost as the requesting thread was not not in the TimedWait and the helper threads exits. Therefore. we end up in a situation that there is no one to send the signal to the requesting tread that the join was done properly.

The simple change that I've done is line 148:

if (fJoined) break;

Because is doesn't matter that much if we received the signal or not as long as the join was done properly. Also notice that this test is done while the mutex is held by the requesting thread so there is no danger of any race conditions.

Revision 43098 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 22 21:57:52 2012 UTC (2 years, 11 months ago) by pcanal
File length: 33659 byte(s)
Diff to previous 42102
Make sure that the thread local gDirectory is initialized to gROOT rather than 0.

Revision 42102 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 17 19:48:22 2011 UTC (3 years, 2 months ago) by rdm
File length: 33321 byte(s)
Diff to previous 41815
silence compiler warning (result unused).

Revision 41815 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 8 18:10:33 2011 UTC (3 years, 2 months ago) by pcanal
File length: 33326 byte(s)
Diff to previous 41108
Protect the internal lock from being used before initialization (from static functions)

Revision 41108 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 4 07:25:09 2011 UTC (3 years, 3 months ago) by pcanal
File length: 33276 byte(s)
Diff to previous 41086
Do not use the user accessible 'global' lock to protect the internals of TThread,
instead use an internal (but still global) mutex.

Having the ambiguity leads to an easy uncesserary dead-lock.

Thread1:
  1. Acquire TThread::Lock
  2. TFile::Open
   3. TClass::GetClass()
      7. TClass::Init
       8. wait for gCINTGlobalMutex

Thread2:
  3. TFile::Open
   4. TClass::GetClass()
    5. TClass::init 
     6. Acquire gCINTGlobalMutex
        9. TNamed::SetName
        10. use gPad
         11. call TThread::Tsd
          12. call TThread::Self
           13. wait for ever and ever on TThread::Lock ....

Revision 41086 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 30 21:27:53 2011 UTC (3 years, 3 months ago) by pcanal
File length: 32783 byte(s)
Diff to previous 40890
Introduce TThreadSlots.h to centralize and formalize the use of the TThread local memory slots amongst the ROOT packages.
Move the definition of gThreadTsd to TROOT.cxx.

Revision 40890 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 15 13:37:40 2011 UTC (3 years, 4 months ago) by rdm
File length: 32627 byte(s)
Diff to previous 39640
From Andrei:
The thread-specific data container is not initialized so one cannot
test if some slot in the array is being used or not.

Revision 39640 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 9 16:40:51 2011 UTC (3 years, 7 months ago) by pcanal
File length: 32589 byte(s)
Diff to previous 39262
Improve behavior of TJoinHelper given the following limitation
of the pthread conditions:

      // When using condition variables there is always a Boolean predicate
      // involving shared variables associated with each condition wait that
      // is true if the thread should proceed. **Spurious** wakeups from the
      // pthread_cond_timedwait() or pthread_cond_wait() functions may occur.
      // Since the return from pthread_cond_timedwait() or pthread_cond_wait()
      // does not imply anything about the value of this predicate, the
      // predicate should be re-evaluated upon such return.

Revision 39262 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 19 09:10:49 2011 UTC (3 years, 8 months ago) by rdm
File length: 31774 byte(s)
Diff to previous 35527
Add new static method TThread::Initialize() that will activate the ROOT
mutexes without the need to create an actual thread.
Also added a number of protections and comments on return codes.

Revision 35527 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 21 12:27:01 2010 UTC (4 years, 4 months ago) by brun
File length: 30360 byte(s)
Diff to previous 34686
do not include snprintf.h

Revision 34686 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jul 31 19:52:20 2010 UTC (4 years, 5 months ago) by pcanal
File length: 30382 byte(s)
Diff to previous 34685
Renamed IsInited to IsInitalizing

Revision 34685 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jul 31 15:08:32 2010 UTC (4 years, 5 months ago) by pcanal
File length: 30377 byte(s)
Diff to previous 32890
Add a clear easy way to tell whether any TThread is in use (this is needed by r34682).
TThread::IsInitalized() now returns true as soon as TThread object is used.

Revision 32890 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 7 08:51:48 2010 UTC (4 years, 9 months ago) by rdm
File length: 30064 byte(s)
Diff to previous 29987
From Mathieu de Naurois:
thread id's are 64-bit on 64-bit machines, fix ctor taking a 32-bit int.

Revision 29987 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 31 17:21:03 2009 UTC (5 years, 4 months ago) by rdm
File length: 30063 byte(s)
Diff to previous 29821
advance the lock.

Revision 29821 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 19 14:14:06 2009 UTC (5 years, 5 months ago) by rdm
File length: 30064 byte(s)
Diff to previous 28166
fix race condition in initializing fgXActMutex in XARequest().

Revision 28166 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 9 09:07:03 2009 UTC (5 years, 9 months ago) by rdm
File length: 29947 byte(s)
Diff to previous 26669
from Bertrand:
remove unneeded lockguard that causes deadlock.

Revision 26669 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 5 09:39:15 2008 UTC (6 years, 1 month ago) by rdm
File length: 29978 byte(s)
Diff to previous 25205
From Bertrand:
fix for creating canvas from thread.

Revision 25205 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 21 21:14:01 2008 UTC (6 years, 5 months ago) by rdm
File length: 29994 byte(s)
Diff to previous 24077
From Bertrand:
Update TThread constructor documentation to specify
"static class method" instead of just "class method".

Revision 24077 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat May 31 19:39:09 2008 UTC (6 years, 7 months ago) by brun
File length: 29972 byte(s)
Diff to previous 22961
Extend the TInterpreter class to support the CINT API used so far by ROOT.
The concrete implementation of the class is in TCint.
The new functions are essentially interfaces to the existing CINT C++ classes
like G__ClassInfo, G__CallFunc, G__DataMemberInfo, G__MethodInfo, G__TypeInfo
and G__TypedefInfo. Most of these functions will call the Reflex interface
once the CINT/Reflex interface will be available later this year.
All direct calls to CINT are replaced by calls like gCint->ClassInfo_xxx where gCint
points to the TCint implementation.
The existing calls to TCint via gInterpreter are kept because on Windows
gInterpreter does not call directly TCint, but instead call TWin32InterpreterProxy
that in turns call TCint.
On Linux and Mac, gInterpreter and gCint are equivalent.

Once the transformation using gCint will be completed, it will be possible
to specify at startup time which version of CINT (CINT or CINT7) by loading
dynamically TCint or TCint7.--This line, and those below, will be ignored--

M    core/meta/src/TStreamerElement.cxx
M    core/meta/src/TCint.cxx
M    core/meta/src/TGlobal.cxx
M    core/meta/src/TBaseClass.cxx
M    core/meta/src/TDataMember.cxx
M    core/meta/src/TInterpreter.cxx
M    core/meta/src/TClass.cxx
M    core/meta/src/TMethodArg.cxx
M    core/meta/src/TDataType.cxx
M    core/meta/src/TMethodCall.cxx
M    core/meta/src/TIsAProxy.cxx
M    core/meta/src/TMethod.cxx
M    core/meta/src/TFunction.cxx
M    core/meta/inc/TClass.h
M    core/meta/inc/TDictionary.h
M    core/meta/inc/TMethodArg.h
M    core/meta/inc/TDataType.h
M    core/meta/inc/TMethodCall.h
M    core/meta/inc/TMethod.h
M    core/meta/inc/TFunction.h
M    core/meta/inc/TCint.h
M    core/meta/inc/TGlobal.h
M    core/meta/inc/TBaseClass.h
M    core/meta/inc/TDataMember.h
M    core/meta/inc/TInterpreter.h
M    core/thread/src/TThread.cxx
M    core/base/src/TVirtualFitter.cxx
M    core/base/src/TStorage.cxx
M    core/base/src/TQConnection.cxx
M    core/base/src/TROOT.cxx
M    core/base/src/TSystem.cxx
M    core/base/src/TQObject.cxx
M    core/rint/src/TRint.cxx
M    core/rint/src/TTabCom.cxx
M    math/foam/src/TFoam.cxx
M    math/minuit2/src/TFitterMinuit.cxx
M    math/mathcore/src/FunctorCint.cxx
M    math/minuit/src/TMinuit.cxx
M    tree/tree/src/TTree.cxx
M    tree/tree/src/TSelectorCint.cxx
M    tree/tree/src/TSelector.cxx
M    tree/tree/inc/TSelectorCint.h
M    roofit/roofitcore/src/RooGenCategory.cxx
M    roofit/roofitcore/src/RooWorkspace.cxx
M    hist/hist/src/TF1.cxx
M    gui/guibuilder/src/TGuiBldDragManager.cxx
M    net/alien/inc/TAlienSystem.h

Revision 22961 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 3 13:32:57 2008 UTC (6 years, 9 months ago) by rdm
File length: 29957 byte(s)
Diff to previous 21532
move the directories:
  base clib cont meta metautils newdelete pcre rint thread unix utils
  winnt zip
under the new core meta directory.

Revision 21532 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 20 12:10:20 2007 UTC (7 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29957 byte(s)
Diff to previous 20882
From Bertrand:
add protection again gSystem disappearing at end of program before the last
thread is finished. There remains a problem with threads.cxx however, that
will be solved later.

Revision 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29944 byte(s)
Diff to previous 20782
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 20782 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 13 13:40:08 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29944 byte(s)
Diff to previous 20411
From Joern Adamczewski:
fixed issue 31085 by just changing the argument of
static TThread::Delete to a reference.

Revision 20411 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 19 12:37:58 2007 UTC (7 years, 3 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29943 byte(s)
Diff to previous 19826
remove conditional around include of RConfigure.h:

#ifdef R__HAVE_CONFIG
#include "RConfigure.h"
#endif 

Having this conditional caused RConfigure.h to be missing from the .d
files and hence these files would not be recompiled after re-configuring
using --prefix.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29972 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 30021 byte(s)
Diff to previous 18326
remove :$ from tag line

Revision 18326 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Mar 18 18:35:22 2007 UTC (7 years, 10 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 30031 byte(s)
Diff to previous 17735
From Bertrand:
Here is a patch for win32 implementation of TThread.
 - Improves speed of a factor 10 in a heavy context switching
   threaded application (by using critical sections).
 - Added R__LOCKGUARD2(gROOTMutex) in TThreadTimer.
 - Added CINT deadlock workaround for WIN32 in TMutex :-\
 - Protected calls to gInterpreter->Execute() in TCanvas.
 - Added gSystem->Sleep(10) in tutorial threadsh1.C

Revision 17735 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 6 15:51:34 2007 UTC (7 years, 11 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 30001 byte(s)
Diff to previous 17586
correctly call a static method.

Revision 17586 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 30 16:35:37 2007 UTC (7 years, 11 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 30006 byte(s)
Diff to previous 17412
From Gerri:
- create fThreadTimer only when really needed

Revision 17412 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jan 20 19:29:35 2007 UTC (8 years ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 29883 byte(s)
Diff to previous 16824
-Remove Varargs.h from TString.h and TObject.h and add this include
in the few files that need it.

-Move the following enums from TBuffer.h to TBufferFile.h

   enum { kMapSize = 503 };
   enum { kStreamedMemberWise = BIT(14) }; //added to version number to know if a collection has been stored member-wise
   enum { kNotDecompressed = BIT(15) };    //indicates a weird buffer, used by TBasket
   enum { kCannotHandleMemberWiseStreaming = BIT(17), //if set TClonesArray should not use memeber wise streaming
          kTextBasedStreaming = BIT(18) };            // indicates if buffer used for XML/SQL object streaming

Revision 16824 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 20 10:02:00 2006 UTC (8 years, 2 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29862 byte(s)
Diff to previous 16796
make copy ctor and assignment operator private and not implemented.

Revision 16796 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 16 17:18:32 2006 UTC (8 years, 2 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 31141 byte(s)
Diff to previous 15601
Changes to get rid of the config.h and HAVE_CONFIG define. These were way
too trivial (just do a locate config.h to see how many there are):
- replace occurances of config.h by RConfigure.h
- add #warning in config.h that is should not be used
- change HAVE_CONFIG to R__HAVE_CONFIG

Revision 15601 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 28 14:27:33 2006 UTC (8 years, 6 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 31137 byte(s)
Diff to previous 15431
comments.

Revision 15431 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 14 18:15:30 2006 UTC (8 years, 7 months ago) by pcanal
Original Path: trunk/thread/src/TThread.cxx
File length: 31127 byte(s)
Diff to previous 15168
From AxeL: Remove cint function declaration which are now part of the CINT header files

Revision 15168 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 24 15:10:47 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 31210 byte(s)
Diff to previous 15134
Fix coding conventions violations

Revision 15134 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 23 04:47:42 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 31115 byte(s)
Diff to previous 15034
From Federico Carminati:

"I have implemented all copy and equal operators needed to silence all
warnings in AliRoot, as requested. I have implemented shallow copies as
would do the default operators synthetized by the compiler.
Most operators are protected. If users complain, you just have to move
them into the public area, but class derivation is of course supported.
It has been a terrible job, I have modified 278 files, but the changes
are backward compabile, and this goes a long way to permitting user to
use the effc++ flag with root headers."

Revision 15034 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun May 14 07:53:19 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 29927 byte(s)
Diff to previous 14988
Fix coding conventions violations

Revision 14988 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 10 15:31:03 2006 UTC (8 years, 8 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29848 byte(s)
Diff to previous 14034
introduce a TGlobalMutexGuard class where the dtor sets the gGlobalMutex
to 0. Create a global static TGlobalMutexGuard object which will cause
the TGlobalMutexGuard dtor to be called when libThread is unloaded (at the
end of a ROOT program). This fixes problems with ROOT crashing at exit
because gGlobalMutex was not 0 and still accessed while the Thread library
was already unloaded.

Revision 14034 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Feb 9 20:46:23 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/thread/src/TThread.cxx
File length: 29548 byte(s)
Diff to previous 13468
Initialize fTsd[1] (now reserved for TClass)

Revision 13468 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 2 22:44:16 2005 UTC (9 years, 1 month ago) by pcanal
Original Path: trunk/thread/src/TThread.cxx
File length: 29512 byte(s)
Diff to previous 12177
Import Matevz Tadel's solution to make the memory allocation of user
object thread safe

Revision 12177 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 23 20:51:14 2005 UTC (9 years, 7 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29207 byte(s)
Diff to previous 12128
From Constantin:
fixes the problem with the global mutex in an efficient way consistent
with the way the local mutexes are implemented.

Revision 12128 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 23 06:24:27 2005 UTC (9 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 29225 byte(s)
Diff to previous 12123
From Constantin Loizides
Use global Mutex instead of class static member

Revision 12123 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 22 20:18:12 2005 UTC (9 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 29226 byte(s)
Diff to previous 11687
From Constantin Loizides

This patch implements:
- decentralized, automatic mutex initialization,
  see R__LOCKGUARD2 in TVirtualMutex
- PROOF parallel startup fixes
- more thread protection (in base, cont, meta, rest to be done)
- cleanups

From Eddy Offermann:
TString::Atoi and Atof are made const.

Revision 11687 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 28 16:14:28 2005 UTC (9 years, 8 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29476 byte(s)
Diff to previous 11101
From Gerri:
Patch introducing parallel startup of the slave servers. This new feature
will considerably reduce the startup time in PROOF setups with many 10's
to 100's of slaves. By default this feature is off, turn it on in the
[system].rootrc file by uncommenting the line:

Proof.ParallelStartup: yes

Summary of changes:

Index: Makefile

  - Add the thread lib to PROOFLIBS

Index: base/inc/TVirtualMutex.h, base/src/TVirtualMutex.cxx

  - Add global mutexes to protect printing and authentication

Index: base/src/TError.cxx

  - Protect static buffer in DebugPrint with specific global mutex

Index: config/Makefile.depend

  - Add dependence on thread lib for PROOF

Index: config/rootrc.in

  - Add description of new envs
      Proof.ParallelStartup, Auth.Timeout, ProofServ.UseSSH

Index: net/inc/TAuthenticate.h

  - Add new member fTimeout to indicate timeout situations
    and new method HasTimedOut() to retrieve it.
  - Add new static member with the timeout value in sec
    and method SetTimeOut() to set it
  - Add new method CatchTimeOut() called at timeout expiration


Index: net/inc/THostAuth.h , net/src/THostAuth.cxx

  - Add new method SetLast() to lower pririty of an attempted
    protocol that has timed-out


Index: net/src/TAuthenticate.cxx

  - Implementation of the new timeout setup using TTimer
  - Add protection using specific global mutex
  - change to start with lower case some local variables
    in Authenticate
  - re-introduce call to THostAuth::CountFailure() (which got
    lost in a previous patch)
  - Disable by default SSH for PROOF servers
  - fix a couple of small memory leaks

Index: net/src/TPSocket.cxx

  - Fix logic in Close() (if called too early (e.g. timeout)
    the underlying socket can still be open and needs to be
    closed).


Index: net/src/TSocket.cxx

  - initialize member fTcpWindowSize in all constructors
  - modify error logging after an unsuccessful authentication
    attempt, checking for timeouts.
  - disable SSH for PROOF servers

Index: proof/inc/TProof.h

  - patch for parallel startup using threads:
    - new methods SlaveStartupThread(void *) and
      SubmasterStartupThread(void *) executed in threads
    - add Bool_t argument to all implementations of StartSlaves

Index: proof/src/TProof.cxx

  - patch for parallel startup using threads:
    - add internal classes ProofThread and ProofThreadArg to keep
      track of started threads and to pass arguments to threads
  - cleanup fPlayer and fFeedBack in destructor

Index: rpdutils/src/rpdutils.cxx

  - fix small memory leak

Index: thread/src/TThread.cxx

  - initialize new global mutexes

Revision 11101 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 11 18:40:09 2005 UTC (9 years, 11 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29352 byte(s)
Diff to previous 10945
remove warnings reported by gcc 4.0.0. Everything compiles without warnings
except for an error in G__Base2.cxx.

Revision 10945 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 18 16:58:48 2005 UTC (10 years ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29336 byte(s)
Diff to previous 10875
remove some unused variables.

Revision 10875 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 5 01:55:13 2005 UTC (10 years ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29368 byte(s)
Diff to previous 10791
change TCondition::TimedWait(ULong_t ms), the relative time version,
to TimedWaitRelative(ULong_t ms) to avoid confusion with the absolute
time version TimedWait(ULong absSec, ULong_t absNanoSec).

Revision 10791 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 15 13:15:14 2004 UTC (10 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29360 byte(s)
Diff to previous 10787
protect the TStorage alloc routines with a new gAllocMutex lock instead
of using the gCINTMutex, this to avoid deadlocks when new threads
are created in code executed via the plugin mananger (which holds the
CINTMutex).

Revision 10787 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 15 12:33:40 2004 UTC (10 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29300 byte(s)
Diff to previous 10781
add TCondition::TimedWait() that takes a relative wait time in milliseconds.

Revision 10781 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 14 17:39:36 2004 UTC (10 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 29396 byte(s)
Diff to previous 10777
From Maarten:
better JoinHelper implementation with proper cleanup.

Revision 10777 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 14 16:56:11 2004 UTC (10 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 28807 byte(s)
Diff to previous 10774
forgot the snprintf.h include for machines not having (v)snprintf.

Revision 10774 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 14 15:06:18 2004 UTC (10 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 28785 byte(s)
Diff to previous 10755
several important changes and fixes:
- remove dependence on direct G__xxx CINT code, since CINT is not
  reentrant there is no change we can currently run interprered function
  as thread functions. This avoids also usage of the CINT lock in
  the thread code which could lead to deadlocks when threads were
  created in a constructor of an object created via the plugin manager
  (which uses CINT to execute the ctor).

- added thread safe versions for the DoError() and ErrorHandler() functions
  which allows TThread::Info() and family to be called from threads.
  Idem for the Printf() function.

- by Maarten, added a join helper thread that will avoid the main thread
  from blocking while doing a join and thereby not being able to process
  events or handle messages sent from the threads via the XARequest
  method.

- fix several memory leaks (valgrind).

Revision 10755 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 10 22:27:21 2004 UTC (10 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 25747 byte(s)
Diff to previous 10748
soome more thread cleanups.

Revision 10748 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 10 12:13:33 2004 UTC (10 years, 1 month ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 25771 byte(s)
Diff to previous 10466
From Maarten and me:
Changelog:

 - Fixed a problem with TSemaphore where the owner of the lock in
   the associated TMutex was not properly updated by the low level
   pthread_cond_wait relock. (always remember our TMutex in TCondition)

 - Unify thread ID's as Long_t

 - Simplify and regularize TThread::Join(). Join with a thread based on
   tid or TThread *, hide implementation more cleanly, remove unnecessary
   member functions and variables (fJoinId et al)

 - Make TThread::Ps() static (easier from cmd line)

 - Use -1 iso 0 for unknown thread id as 0 is a valid value

 - add more error checking in lots of places

 - move gContainerMutex and gCINTMutex initialisation with the rest of
   the one time init bunch.

 - Simpify Exists()

 - Lock *all* access to the global thread list

Revision 10466 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 3 22:54:15 2004 UTC (10 years, 2 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 25746 byte(s)
Diff to previous 10449
small code cleanup.

Revision 10449 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 2 13:07:58 2004 UTC (10 years, 2 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 25968 byte(s)
Diff to previous 10061
From Bertrand Bellenot:
added thread support for Win32. Like on Linux it is enabled by default
and can explicitely turned off via ./configure --disable-thread.

Revision 10061 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 15 14:39:03 2004 UTC (10 years, 4 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 25758 byte(s)
Diff to previous 9439
remove the & to take the address of a static function. It is redundant
and caused a compile error on Solaris 8.

Revision 9439 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 8 11:52:32 2004 UTC (10 years, 6 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 25765 byte(s)
Diff to previous 8360
several cleanups and a fix that allows TThreads to run also when not
in the TApplication eventloop.

Revision 8360 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 11 10:40:10 2004 UTC (10 years, 10 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 26136 byte(s)
Diff to previous 6610
Remove direct dependencies of the class TThread from TCanvas.
Direct calls to TCanvas::Constructor and Destructor functions are executed
via gROOT->ProcessLine

Revision 6610 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 13 10:29:07 2003 UTC (11 years, 8 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 24889 byte(s)
Diff to previous 5726
Print some start/finish messages conditional to gDebug

Revision 5726 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 3 16:44:25 2002 UTC (12 years, 1 month ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 24823 byte(s)
Diff to previous 4668
From  Mathieu de Naurois <denauroi@in2p3.fr>
"From the manual of pthread_cond_timedwait, I have:

 pthread_cond_timedwait  atomically  unlocks mutex and waits on
cond, as pthread_cond_wait does, but it also bounds the duration
of the wait. If cond  has  not  been  signaled  within  the amount
of time specified by abstime, the mutex  mutex  is  re-acquired
and pthread_cond_timedwait returns  the error ETIMEDOUT.
The abstime parameter specifies an absolute time, with the same
origin  as  time(2)  and gettimeofday(2):  an abstime of 0
corresponds to 00:00:00 GMT, January 1, 1970.

In the code of ROOT, the line:

 while (fgXAct) {fgXActCondi->TimedWait(1);}

was a nonsense that it equivalent to :
while(fgXAct);

and it uses 100% of CPU.

I modified the TThread class in the version we use for HESS.
For us, in a heavily multithreaded DAQ, this modified version works fine
and is faster when opening canvases from threads."

Revision 4668 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 6 15:12:50 2002 UTC (12 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 24067 byte(s)
Diff to previous 4622
Protection by Mathieu de Naurois in case no thread has been created.
root [0] TMutex t(kTRUE);
root [1] t.Lock()

 *** Break *** segmentation violation

Revision 4622 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 30 19:43:07 2002 UTC (12 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 24035 byte(s)
Diff to previous 4158
From Mathieu de Naurois additional LOCKGARD statements in some critical places
when using Threads.

Revision 4158 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Mar 9 09:58:22 2002 UTC (12 years, 10 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23997 byte(s)
Diff to previous 4076
The message "thread xx is running is now printed only if gDebug != 0

Revision 4076 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Feb 23 16:01:44 2002 UTC (12 years, 11 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 23986 byte(s)
Diff to previous 4056
small formatting corrections of mutex code.

Revision 4056 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 22 09:37:29 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 24002 byte(s)
Diff to previous 3468
Patch from Mathieu de Naurois adding Thread-safety in many ROOT classes.
A new TVirtualMutex global is defined in TVirtualMutex.h (gCINTmutex).
gCINTMutes is used in TMethodCall to protect concurrent access to CINT.
The R__LOCKGUARD macro is introduced in many classes to check for a mutex.
The performance penalty introduced by the MUTEX logic
 -is ZERO in the application has no threads
 -about 10% in case of threads

Revision 3468 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 12 13:56:13 2001 UTC (13 years, 1 month ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23852 byte(s)
Diff to previous 2588
Fix a typo (TThreadPosix changed to TPosixThread)

Revision 2588 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 17 14:38:41 2001 UTC (13 years, 6 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23852 byte(s)
Diff to previous 2506
Proposed by Mathieu de Naurois: a new option kMETH in TThread::Xaction.
A function may be executed by the main Thread via a TMethodCall.
Example of use:
void DaqRead::CanvasManager::Update()
{
  // We made the update occur in the Main Thread
  // to avoid dead lock with mouse/pad action
  // which can lock the DaqRead::CanvasManager::mutex
  if (gThreadXAR) {
    TMethodCall c(IsA(),"Update","");
    void *arr[4];
    arr[1] = &c;
    arr[2] = (void *)this;
    arr[3] = (void*)"";

    if ((*gThreadXAR)("METH", 4, arr, NULL)) return;
  }

  mutex.Lock();
  Emit("Update()");
  mutex.UnLock();
}

Revision 2506 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 2 16:35:24 2001 UTC (13 years, 6 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23670 byte(s)
Diff to previous 2460
Pointer fHolder should be initialized in the constructor (thanks Mathieu de Naurois).

Revision 2460 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 26 10:21:14 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23652 byte(s)
Diff to previous 2385
Mods proposed by Mathieu de Naurois.
Protections in Lock, TryLock, Unlock when no Thread created.
Users may have TThread::Lock in many places and run in single or multi-threaded mode.

Revision 2385 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 6 13:41:43 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23595 byte(s)
Diff to previous 2357
The following mods by Mathieu de Naurois. The following was an email from Matthieu

"You set the Thread Id at two different places.
1) in Int_t TPosixThread::Run(TThread *th)

  th->fId = id; SetUniqueID(th->fId);

2)in void *TThread::Fun(void *ptr)

  th = (TThread *)ptr;
  th->fId = SelfId(); th->SetUniqueID(th->fId);

The second solution is the only good one, because the Thread uses its it
in the TThread::Fun
function. So if TPosixThread::Run was not fast enough, you get a clash.

BUT, in TThread::Fun(void *ptr) you use the Id before assigning it, in
the following call
  CleanUpPush((void *)&AfterCancel,th);  // Enable standard cancelling
function

So, I suggest to move the Id definition before that call."

Revision 2357 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jun 2 17:22:05 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23587 byte(s)
Diff to previous 2341
Preset member fClean in Constructor

Revision 2341 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 31 16:23:10 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 23571 byte(s)
Diff to previous 1887
The following mods proposed by
           Mathieu de Naurois <denauroi@lpnhep.in2p3.fr>
New Thread constructor to connect to an existing running thread.
New cases in XAction.

Remove a gSystem->Sleep(10000); !!

Revision 1887 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 3 10:40:24 2001 UTC (13 years, 9 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 22514 byte(s)
Diff to previous 640
the thread id must be a Long_t (maps to pthread_t which is a long). Number of
signature changes from Int_t to Long_t.

Revision 640 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 13 07:58:21 2000 UTC (14 years, 4 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 19516 byte(s)
Diff to previous 365
Several non-critical prints will now be executed only if gDebug >0

Revision 365 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jul 12 16:37:21 2000 UTC (14 years, 6 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 19318 byte(s)
Diff to previous 230
Update for KCC (sgi).

Philippe.

Revision 230 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 16 12:24:47 2000 UTC (14 years, 7 months ago) by brun
Original Path: trunk/thread/src/TThread.cxx
File length: 19296 byte(s)
Diff to previous 3
Add new static member function (proposed by Marc Hemberger)
   static Int_t TThread::Exists();
This function returns the number of running Threads.

Revision 3 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: trunk/thread/src/TThread.cxx
File length: 18902 byte(s)
Copied from: branches/rdm/thread/src/TThread.cxx revision 2
Diff to previous 2
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.

Revision 2 - (view) (download) (as text) (annotate) - [select for diffs]
Added Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: branches/rdm/thread/src/TThread.cxx
File length: 18902 byte(s)
Initial import of ROOT into CVS

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9