Download MetaTrader 5
To add comments, please log in or register
Articles can help you to solidify your knowledge. Come and read them!
simha
144
simha 2015.02.08 13:36 

Hello,

 

Terminal global variables are available for concurrent access from all running EAs. Each EA runs on its own thread (as stated on official documentation).

Is access (Read/Write) to global variables assured to be race-condition-free?

 

More Generally: Can the MT4 terminal start processing a tick of symbol B, while a previous tick of symbol A is being processed?

 

Thanks much. 

whroeder1
13610
whroeder1 2015.02.08 15:11  
Simha:
Is access (Read/Write) to global variables assured to be race-condition-free?
More Generally: Can the MT4 terminal start processing a tick of symbol B, while a previous tick of symbol A is being processed?
  1. Only OnCondition could be, which I used it to write a mutex.
  2. Yes. That is exactly what "Each EA runs on its own thread" means.
Carl Schreiber
5940
Carl Schreiber 2015.02.08 15:11  

The GlobalVariables have a time stamp of the last access: GlobalVariableTime("name") which seems to be the local (pc) time (not TimeCurrent()) and is accurate to the nearest second.





simha
144
simha 2015.02.08 15:42  
WHRoeder:
  1. Only OnCondition could be, which I used it to write a mutex.
  2. Yes. That is exactly what "Each EA runs on its own thread" means.

Thanks for the useful answer.

simha
144
simha 2015.02.08 15:43  
gooly:

The GlobalVariables have a time stamp of the last access: GlobalVariableTime("name") which seems to be the local (pc) time (not TimeCurrent()) and is accurate to the nearest second. 

Thanks. I've found this useful.

/
To add comments, please log in or register