Multiply TThread on multiply cores

I came across a problem - it seems that my multithreaded ROOT app uses only single core. I tried also thread samples and they too seem to use a single core. Thread::Ps() returns two threads running at the same time, so I guess it should be scheduled to multiple cores…

Is there anything special I should specify during compilation or some other trick to make TThreads tun on multiple cores?

I have to add that normal pthreads work fine on my machines - two threads are split over to two cores, top showing ~195% of CPU usage for the process. No such think with ROOT TThreads. Really, noone can help?

OK, finally I found the problem. Frequently used TThread::Lock() caused only 1 core to be used.

It seems for me, that the same problem is visible in the only tthread sample from tutorial, that utilizes lot’s of cpu - threadsh1.C. Not sure about that, but perhaps this sample should/could be rewritten to make use of multiple cores.


Simply reducing the frequency of the updates (by increase the value of upd) will get you the desired effect in threadsh1.C