Using ROOT GUI in a multithread application

Hello ROOTers!
I try to build a multi-thread application using GUI ROOT classes. It seems that some collisions appears between threads leading to a crash of my application. Is there any mandatory things to indicate in my source code of my application to avoid collisions and crashes ?

Thank you for your help

Daniel


ROOT Version: 6.24/06
Platform: Ubuntu 20.04.1
Compiler: gcc 9.4.0


Hi @DanielCussol,

Take a look at ROOT::EnableThreadSafety().

Perhaps, and depending on your use case, you might also be interested in ROOT::EnableImplicitMT().

Cheers,
J.

Hi Daniel,

Be aware that ROOT graphics is not thread safe and should be handled always from the main thread.

Regards,
Sergey

Hi Seguey,
Thank you for your answer. It seems that the use of a TTimer or a derived class of TTimer to update widget contents leads to the crash. It seems that updating the widget content in a specific thread works.

Regards

Daniel

Thank you for your answer. I have call the ROOT::EnableThreadSafety() method but the problem was still there. It seems that the use of a TTimer or a derived class of TTimer to update widget contents leads to the crash. It seems that updating the widget content in a specific thread works.

Thank you for your help !
Daniel