Reading multiple root files at the same time

I have an application where it would be great to read multiple root files at once. The files arrive at arbitrary intervals and in most cases one thread is started to read the file just arrived. I understand that ROOT is not thread safe in general, however, I am hoping someone would tell me that there is a way to read multiple root files at the same time since I am not modifying anything. Anything less than a global mutex lock would be useful for me. Thanks.

OK. My current implementation puts a mutex lock around TFile::Open call. This appears to be the minimal thing I can do to get it working properly. Without this mutex, when multiple files arrive at the same time, there is usually some kind of segmentation problem in what appears to be a function invoked by Init. If anyone has any other way of reducing the scope of lock, I would be very glad to try it. Thanks.

Hi, Everyone,

Just came across a case where TFile::Init failed again. This would indiate to me that a mutex lock around TFile::Open is not sufficient to guarantee safe reading of multiple files. I have gone back to have mutex lock on all ROOT related operations from Open to Close. If there is anyway to reduce the need of mutex lock, I would really appreciate the information.