I have dual core processor and noticed each time when I run a macro with ROOT it uses only one core but other is idle. I found this situation very frustraiting
Is there any way to use both cores when I running ROOT?
Thank you!
==
OS: WinXP, ROOT 5.14 (I use gcc/Cygwin as well as VC6)
Yes, you can use threads. Try the macro in attachment. To run it: “.x pirndmthread.C+”.
The threads will be distributed to your cores (if you have a quad-core, it will use the four processors…)
Do I understand correctly that you renamed the file ‘pirndmthread.C+’??
Please don’t. The + in ‘.x pirndmthread.C+’ tells Root to compile the macro using ACLiC (please read the documentation).
And I don’t see any problem running this on Windows (it has even been developped on Windows…):
Yes, I did wrong since I renamed the file, it was stupid. But now I hope I do right but get an errors again. Maybe this is because I’m using VC++ v6.0 (as you noticed before)?
root -l
root [0] .x pirndmthread.C+
Info in TWinNTSystem::ACLiC: creating shared library C:\cygwin\home\Mustang\an
alysis\susy\pirndmthread_C.dll
23868109_cint.cxx
s5jo_.cxx
C:\root/include\TDatime.h(101) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(43) : see declaration of 'fDatime’
C:\root/include\TDatime.h(101) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(43) : see declaration of 'fDatime’
C:\root/include\TDatime.h(103) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(43) : see declaration of 'fDatime’
C:\root/include\TDatime.h(103) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class ‘TDatime’
…
C:\root/include\TDatime.h(43) : see declaration of 'fDatime’
C:\root/include\TH1.h(368) : fatal error C1903: unable to recover from previous
error(s); stopping compilation
Error in : Compilation failed!
Error: Function pirndmthread() is not defined in current scope (0)
*** Interpreter error recovered ***
root [1]