Read TChain in TThreads

Hello Rooters,

I’m trying to read few, same-structure TChains in few TThreads (one TChain per TThread).

Each TChain has the same structure (branches) but the contents and sizes are different (different physics processes).
Each TThread runs the same process on its own TChain and fills a set of its own histograms.
There’s no overlap, i.e. there’s no situation where two TThreads try to access the same object at the same time (either the TChain, histograms or whatever).

All the TChains and the histograms are defined and instantiated in memory BEFORE the TThreads are defined and executed, i.e. there’s no need to lock and unlock within each TThread as far as I understand since none of these is defined there.

[] When I try to run with one TThread, there’s no problem and the process exits normally doing everything it was supposed to - processing the single TChain and filling the histograms.
[
] When I try to run with several (>1) TThreads, there are inconsistent crashes which do not seem to tell a lot, occurring in different places around the GetEntry or LoadTree calls.
[*] When I try to use several TThreads but with a dummy analysis that simply counts from 0 to 10 and nothing else (no TChains, no histograms etc.) then all the TThreads run fine and the process exits normally (of course).

This is too small for PROOF/grid/batch which would be an overkill, but it is too large (well, lengthy) for serial processing.

I’d really want to make it work…

Cheers,
Noam

Anyone ???
Reading few trees in few tthreads without crashes ?