|Message: Re: Geant4 error propagation package in MT Frameworks||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
Unfortunately given the manpower we have we had to set priorities and this module was not tested extensively for the final release. However the basic migration to MT was carried out, and in principle it is possible to test the module in a MT environment.
In particular, regarding the use of static data: you may notice that the additional keyword "G4ThreadLocal" is used in conjunction with static data in the class G4ErrorPropagationData. This is a #define to __thread (on linux) that implements thread-local-storage. That is each thread has its own (static) copy of the objects. This mean that the use of this class (at least at first order) should be thread-safe. Since the singleton itself if a "thread local" object, you can safely call concurencly GetErrorPropagatorData::GetErrorPropagatorData() instance getter.
Important: Note that G4ThreadLocal is defined only if G4MULTITHREADED is a defined compilation option (e.g. -DG4MULTITHREADED), if you use G4's cmake or makefile system that is already done for you, otherwise take care of adding this to the compilation options of your system. Take a look at file: geant4-source/source/global/management/include/tls.hh for more information.
Some information on Thread-safety in G4 is given in these presentations: Introduction: http://geant4.slac.stanford.edu/SLACTutorial14/MultiThreadingI.pdf Details: http://geant4.slac.stanford.edu/SLACTutorial14/MultiThreading2.pdf Much more info on memory management in G4 for MT: http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForToolkitDeveloper/html/ch02s14.html
Please let me know if you need more information. Andrea
|Inline Depth:||Outline Depth:||Add message:|