|
QuantShare
2014-08-18 05:26:29
0
|
|
Best Answer
Hi Dave,
Global variables are thread safe, however you are running simulation in multi-threading and thus each simulation is run in a separate thread.
Since these variables are shared by all programs, you may easily come into a situation where you update it in the first MM of the first simulation then reads its value from the second MM of the second simulation.
In order to fix this, you must create a different variable for each simulation. Here is how you can do this:
Global.SetVariable("Name_" + Functions.SimulationID, "Value");
"Functions.SimulationID" is available in the "OnStartSimulation" only, so you can store it in a variable in the "Global" event if you want to access it from other events.
|
|