One question, If 1 EA runs on 1 thread, then it seems onTimer won't be called while onTick has some blocking function call or sleep more than timer interval??
Why don't MT5 separating timer event thread? because of Mutex implementation?
humbertobrandao Brandao: Because to implement a mutex, I need to call a special function that runs a System Call on OS. But I don't know if this function exists in MQL5.
this question is old, so maybe some changes were made from then to now. So I'ld like confirmation:
1) Does any EA still runs in the same thread, including OnTimer events? 2) Do I still need to implement a mutex system to access Global Variables of the Terminal?
I have the impression once I read about a recent version of MT5/MQL5 including some native mutexes, so external libraries (such as https://www.mql5.com/pt/code/1835) are no longer necessary. Am I right?
this question is old, so maybe some changes were made from then to now. So I'ld like confirmation:
1) Does any EA still runs in the same thread, including OnTimer events? 2) Do I still need to implement a mutex system to access Global Variables of the Terminal?
I have the impression once I read about a recent version of MT5/MQL5 including some native mutexes, so external libraries (such as https://www.mql5.com/pt/code/1835) are no longer necessary. Am I right?
Nothing has changed. You may need a mutex when accessing GVT.
One question, If 1 EA runs on 1 thread, then it seems onTimer won't be called while onTick has some blocking function call or sleep more than timer interval??
Why don't MT5 separating timer event thread? because of Mutex implementation?
This is question for Metaquotes, you can ask them on the ServiceDesk.
For now, 1 thread by EA, you have to deal with.
I want to know if I need lock a file while writing...
If it's writing half way, then another EA of mine come to read data...only get a half?
Should I worry about that ? or the file lock is set default in MQL ?
Many Thanks.
I want to know if I need lock a file while writing...
If it's writing half way, then another EA of mine come to read data...only get a half?
Should I worry about that ? or the file lock is set default in MQL ?
Many Thanks.
This totally depends on how you are using the files!
If you open a file you can determine whether the access is shared or not - see FileOpen() in the Reference of the Editor (F1)
Because that's how they made it. We can't read their minds. Ask them, not us users.
Global Variables of the Terminal / GlobalVariableSetOnCondition - Reference on algorithmic/automated trading language for MetaTrader 5
this question is old, so maybe some changes were made from then to now. So I'ld like confirmation:
1) Does any EA still runs in the same thread, including OnTimer events?
2) Do I still need to implement a mutex system to access Global Variables of the Terminal?
I have the impression once I read about a recent version of MT5/MQL5 including some native mutexes, so external libraries (such as https://www.mql5.com/pt/code/1835) are no longer necessary. Am I right?
Hi,
this question is old, so maybe some changes were made from then to now. So I'ld like confirmation:
1) Does any EA still runs in the same thread, including OnTimer events?
2) Do I still need to implement a mutex system to access Global Variables of the Terminal?
I have the impression once I read about a recent version of MT5/MQL5 including some native mutexes, so external libraries (such as https://www.mql5.com/pt/code/1835) are no longer necessary. Am I right?