Open faustus123 opened 2 years ago
BTW how JGlobalRootLock relates to ROOT EnableThreadSafety() which enables global lock also. Could it be moved on root? Or it is too uncontrollable?
I think the primary use case of modifying TTree and TH* objects will still require our own lock according to the documentation you point to. Those objects are considered "conditionally" thread safe, but since we are typically filling them from multiple threads, they will need to be synchronized.
C++ adds a read-write mutex/lock guard called std::shared_mutex
/lock
. The catch is that it is C++17, so I doubt it will work on gcc4.8.5.
And 4.8.5 is a requirement for Gluex/JLab? As EIC soft is on C++17
It would be great to have the equivalent to a lock_guard for the JGlobalRootLock service. Probably need two, a read and a write. Could we implement something that would support something like:
auto lck = m_lock->LockGuardWrite();