Asynchronous and multi-threaded programming in MQL - page 6

 
Andrey Pogoreltsev:

MQL5 has asynchrony, e.g.OrderSendAsync.

As for interaction with network or file system - use WinAPI, I wrote above solution. I think everything is there for that. You can read about how to use these methods on Microsoft site. What else remains to be discovered?)

Yes,I know aboutOrderSendAsync, but it's only for sending requests.
I was looking in this direction
of WinAPI, but unaware that the threads are not available in mql, the prototypes in the inluder were misleading.

 
Andrey Pogoreltsev:

MQL5 has asynchrony, for exampleOrderSendAsync.

MQL4/5 has always had asynchronous and multi-threaded execution of MQL codehttps://www.mql5.com/ru/docs/runtime/running.

i.e. everything is "out of the box", the only problem is data exchange between MQL programs, there is no ready-made solution from developers, or rather there are only global variables of the terminal - so they have designed data exchange - very inconvenient and inefficient, but there are ready-made solutions for data exchange in QB

You mentioned above learning NS - it requires multithreading, well, yes, but MT comes only with Alglib and I've used it as long as I have not seen that it takes more than 1-2 seconds to learn NS, i.e. why is it fast? - If you will use third-party packages of NS - there are no options, you will have to go beyond MT - use dll, then again, what is the problem with data exchange and multithreading? - all implemented in a dll.

there was a mention of pythons... I'm not talking about speed there, it's a very specific environment for NS development, everything seems to be there, but it's just impossible to use it - wait and wait... the most entertaining thing is to work with NS in Python! )))

SZZY: Python doesn't have multithreading in its normal sense, but I could be wrong. I hate Python - a lot of noise and mainstream, everything works out of the box, but ..... but it's just not possible to work with such a slow system, the only pluses are a lot of ready-made Python code and a large Internet community

 

Why are naked pointers so unsafe?

I think the developers are lying, and the real reason is to prevent pulling from the dll. Most likely some tricky calling convention was put in too.

 
Vict:

Why are naked pointers so unsafe?

In my opinion, the developers are lying, and the real reason is to prevent pulling from the dll. Most likely some tricky calling convention was put in too.

As the moderator wrote, access to physical memory addresses is denied for security reasons.
Through which skilled, unscrupulous coders can gain access to any element of the compiled program.

 
Roman:

As the moderator wrote, access to physical memory addresses is denied for security reasons.
Through which skilled, unscrupulous coders can gain access to any element of the compiled program.

I find this hard to believe. We just don't need the competition with mature languages. And all these tricks, like changing size when recompiling, for the same purpose.

 
Vict:

I find it hard to believe. It just doesn't need competition from mature languages. And all these tricks, like changing size when recompiling, for the same purpose.

No, it is, remember the mass decompilation in mql4, the accumulated errors have been taken into account and protection has been implemented.
By and large, this is an effective security choice, to the detriment of direct WinAPI calls, but since the dll is open, the functionality does not change, the way of interaction does.
Therefore, you will not encounter any decompiling or potential hacking of your program. And this is good and kudos to the developers.

 
Vict:

Why are bare pointers so insecure?

admin Renat always replied to such questions that Metaquotes always chooses a solution that is guaranteed to provide security, well alternatively, you get a pointer to memory and can inject a virus that can add its code to the compiled ex4 / ex5


Roman:

at the expense of making direct WinAPI calls

What's the harm? You have a main program running in a main process, it won't run without the main program - is that clear?

- Can you run a function body from Python in a separate process using WinAPI ?

-..... function body from Java using WinAPI ?

-..... function body from WordBASIC using WinAPI ?


as an option, here Metakvot gave a clear answer - this functionality is not provided, go further down the instances: write to Python Software, Oracle, Microsoft - blow their brains out yet

)))

 
Roman:

No no, that's how it is, remember the widespread decompilation in mql4, the bugs were taken into account and protection was implemented.
By and large, this is an effective security choice, to the detriment of direct WinAPI calls, but since access to the dll is opened, the functionality is not changed, the way of interaction changes.
Therefore, you will not encounter any decompiling or potential hacking of your program. And this is good and respect to developers.

Taken into account, and podcasts from the marketplace started compiling into nativ

Renat

It is already weakly decompilable since build 500, as the security system has been completely changed.

After the migration to MQL5 engine and Market, the decompiler theme will die completely. Who don't know - products from Market are compiled in 32/64 nativ (pure assembly, no way to decompile) at the time of purchase and encrypted for the buyer's hardware.

And decompiling from some other sites methacquot even profitable - to drive everyone to themselves by scary and evil decompiles. In general - nothing personal, just business.
 
fxsaber:

In MQL only, both tasks are solved by automatically running an EA count.

Exactly, that's how I do it. However, I don't use Web-Request, but auto-optimization - for me and TC League - works in full force. And the selection is done in several passes, first, a "clean" system is optimized and its parameters are fixed, then break-even optimization is run and its parameters are fixed, and then optimization of protective SL (if necessary) is run. And there is work with frames and processing of data from them everywhere.

All necessary multithreading is already in place.

 
Igor Makanu:

admin Renat always replied to such questions, that Metaquotes always chooses a solution that is guaranteed to provide security, well alternatively, you get a pointer to memory and can inject a virus that can add its code to the compiled ex4 / ex5

Do you really think I can't run a terminal with an Expert Advisor under a debugger and find what relative address the execution starts from? The address of any function or variable? Another thing is that these addresses may change (because of the tricks applied), but in theory I can find out everything that normal pointers would give me.

The other thing that scares them is to find out function addresses via pointers in runtime and yank them in dlls.