[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 380

 
Zhunko:
How to arrange the queue in a programming language depends on the programmer. Kernel-level queuing is executed by the system and is not guaranteed.


So here we go. In your code shown a bit earlier, the queue is not organized. And what the system doesn't guarantee is what you're talking about and what you should do yourself. But in some cases it is easy and simple to do, and in some cases you will have to think and code a lot, because there are no special tools for that.

Vadim, you have an interesting way of talking, it's as if you forget what the conversation was about or you have a special wisdom. First you showed the code and argued that the order is respected, and now you put forward the thesis-postulate that it is not guaranteed... Sometimes you contradict yourself but this is not flexibility of mind.

 
Integer:


And there you have it. In your code shown a bit earlier, the queuing is not organized. And the fact that it's not garnered by the system is what we're talking about, and what to do on your own. But in some cases it is easy and simple to do, and in some cases you will have a lot of code and thinking, because there are no special tools for that.

Vadim, you have an interesting way of talking, it's as if you forget what the conversation was about or you have a special wisdom. First you showed the code and argued that the order is respected, and now you put forward the thesis-postulate that it is not guaranteed... You may sometimes contradict yourself, but that's not flexibility of mind.

Dim, another complaint? The queue is respected according to the capabilities of the system. What else can you demand from the system?

I have never had to arrange any other queues. The system has enough capacity. For some reason, they do not guarantee kernel level queuing. But atomic execution is guaranteed.

 
Zhunko:

Dim, another complaint? The queue is kept according to the capacity of the system. What else can you demand from the system?

I have never needed to organise any other queues. The system has enough possibilities. For some reason, they do not guarantee kernel level queuing. But atomic execution is guaranteed.

If according to system capabilities, then queuing is not ensured. But you started arguing that it is provided. Then you began to prove that it is not ensured. Now we have indulgence - that according to the system possibilities:). The fact that you never needed to provide a sequence depends on your principled approach to programming. Some of the functions in your well-known library require queuing. Since you don't provide a guaranteed queue, congratulations! I don't have any complaints, just don't make a big deal out of it and cover everything with some myth of mystery, secrecy and something else beyond anything else.

 
Thank you!!!
 
Integer:

If according to the system's capabilities, it means that the order is not ensured. But you began to argue that it is ensured. Then you began to prove that it is not ensured. Now it's indulgence - that according to system's possibilities:) The fact that you never needed to provide a sequence depends on your principled approach to programming. Some of the functions in your well-known library require queuing. Since you don't provide a guaranteed queue, congratulations! I don't have any complaints, just don't make a big deal out of it and cover everything with some myth of mystery, secrecy, and something else beyond anything else.

The system enforces a queue in some order that you don't like, and that doesn't match the queue order of the modules that are waiting to be executed. Is this what you call a queue absence?

To me, any queue is a queue. Including the kernel-level execution queue. It's a black box. Take it for what it is. You need your own queue with its own order - arrange it yourself.

There is no need for a special order in that library. I use different synchronization objects. It doesn't matter in what order it is executed. You don't have to think about it. The system will do everything by itself.

I don't understand what I mean about being mysterious. Again with the fantasy? :-))

 
Zhunko:

1. The system enforces a queue in some order which you don't like, and which doesn't match the queue order of the modules that are waiting to be executed. Is this what you call a queue absence?

2. To me, any queue is a queue. Including the kernel-level execution queue. It is a black box. Take it as it is. You need your own queue with its own order - organize it yourself.

3. There is no need in that library for a special order of execution. I use different synchronization objects. It does not matter in what order it is executed. You do not have to think about it. The system will do it all by itself.

4. I do not understand what I mean about being mysterious. Again with the fantasies? :-))


1. Providing atomic access absolutely does not imply providing any uniform order of access. The order of accessing functions will be practically accidental, which does not exclude that some function won't be left out at some period of time.

2. Not a black box, but completely absent. The order of execution is as granny from the seventh floor sneezes.

3. However, there is a need to ensure equal execution of all functions (or more precisely, to address terminals in a bundle). Sometimes it seems that you do not understand what we are talking about. You have, you don't. And always with such a twist... If there is no, then there is, but it is not that and not so...

4. You, Vadim, are so wrapped up that you do not understand what you are wrapped up in, how you are wrapped up in and for how long...

 
Bought a lot of processor cores. And now which one to queue up for)))))))))
 
Integer:


1. Providing atomic access does not at all imply providing any uniform order of access. The order in which the functions are accessed will be almost random, which does not rule out the possibility that some function will not be left out at some period of time.

2. Not a black box, but completely absent. The order of execution is as granny from the seventh floor sneezes.

3. However, there is a need to ensure equal execution of all functions (or more precisely, to address terminals in a bundle). Sometimes it seems that you do not understand what we are talking about. You have, you don't. And always with such a twist... If there is no, then there is, but it is not that and not so...

4. You, Vadim, are so wrapped up that you do not understand what you are wrapped up in, how you are wrapped up and for how long...

You seem to have divided up the points, but you are not answering according to the meaning. Yeah, you don't have to answer there either. I get that for you, the queue and the order of execution are the same thing. That's why you don't know what I'm talking about.

If you want uniform execution, you should use a single thread. You won't need synchronization then. How can you ensure uniform execution of threads, whose runtime and number are unknown?

Mine is simple. In and out of the protected block, as it should be by the science of programming. No need to bother with your special queue at all. You'll figure it out someday.

Yeah, you're also dead wrong about the highlighted one. Properly done synchronization (i.e. no errors in code or logic) executes all threads. This is guaranteed by the system as opposed to the order of execution.

 
Zhunko:

1. You seem to have broken down the points, but you're not answering in a meaningful way. Yes, you don't have to answer there either. I understand that for you, the queue and the order of the queue are one and the same. That's why you don't know what I'm talking about.

2. If you need uniform execution, use a single thread. You won't need synchronization then. How can you ensure uniform execution of threads, which execution time and number are not known?

3. I have it simple. In and out of protected block, as it should be by the science of programming. No need to bother with your special queue at all. You'll figure it out someday.

4. Yeah, you're also dead wrong about the highlighted one. Properly done synchronization (i.e. no errors in code or logic) executes all threads. This is guaranteed by the system as opposed to the order of execution.


1. You must have comprehension problems. I know what you're talking about.

2. Thanks, but I wasn't asking for advice. Especially since we are discussing synchronization of something which is not already in a single thread.

3. the way it should be done according to the science. What science? Your own science? Someday you will understand it, but there is nothing complicated about it. Programming languages and algorithms were not invented and created by fools. But for some reason they are provided with means of synchronization and queuing.

4. very wrong. If correct....If there was synchronicity. But in that code you cited here a bit earlier there is no synchronicity, only atomic access.

 
Zhunko:

The queue is organised as in any other language. By itself through the organisation of the input and output of the block to be protected.

This is a script:

As for downsizing, like replacing it with other functions, it won't work. This is what atomic access is all about. Only one function can do this in MQL4.

It seems to work fine. Loaded 6 scripts with pauses of 3000, 2000, 1000, 500, 300, 200. Here's part of the log:

19:58:36 Check_GlobalVariableSetOnCondition() GBPJPY,M1: GBPJPY Start
19:58:37 Check_GlobalVariableSetOnCondition() GBPJPY,M1: GBPJPY End
19:58:37 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD Start
19:58:39 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD End
19:58:39 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD Start
19:19:58:39 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD End
19:58:39 Check_GlobalVariableSetOnCondition() AUDUSD,M1: AUDUSD Start
19:58:43 Check_GlobalVariableSetOnCondition() AUDUSD,M1: AUDUSD End
19:58:43 Check_GlobalVariableSetOnCondition() GBPUSD,M1: GBPUSD Start
19:58:43 Check_GlobalVariableSetOnCondition() GBPUSD,M1: GBPUSD End
19:19:58:43 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD Start
19:58:45 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD End
19:58:45 Check_GlobalVariableSetOnCondition() GBPUSD,M1: GBPUSD Start
19:58:46 Check_GlobalVariableSetOnCondition() GBPUSD,M1: GBPUSD End
19:58:46 Check_GlobalVariableSetOnCondition() NZDUSD,M1: NZDUSD Start
19:19:58:46 Check_GlobalVariableSetOnCondition() NZDUSD,M1: NZDUSD End
19:58:46 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD Start
19:58:46 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD End
19:58:46 Check_GlobalVariableSetOnCondition() NZDUSD,M1: NZDUSD Start
19:58:47 Check_GlobalVariableSetOnCondition() NZDUSD,M1: NZDUSD End
1919:58:47 Check_GlobalVariableSetOnCondition() GBPJPY,M1: GBPJPY Start
19:58:48 Check_GlobalVariableSetOnCondition() GBPJPY,M1: GBPJPY End
19:58:48 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD Start
19:58:50 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD End
19:58:50 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD Start
19:19:58:50 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD End
19:58:50 Check_GlobalVariableSetOnCondition() AUDUSD,M1: AUDUSD Start
19:58:54 Check_GlobalVariableSetOnCondition() AUDUSD,M1: AUDUSD End
19:58:54 Check_GlobalVariableSetOnCondition() NZDUSD,M1: NZDUSD Start
19:58:54 Check_GlobalVariableSetOnCondition() NZDUSD,M1: NZDUSD End
19:19:58:54 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD Start
19:58:56 Check_GlobalVariableSetOnCondition() EURUSD,M1: EURUSD End
19:58:56 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD Start
19:58:57 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD End
19:58:57 Check_GlobalVariableSetOnCondition() AUDUSD,M1: AUDUSD Start
1919:59:00 Check_GlobalVariableSetOnCondition() AUDUSD,M1: AUDUSD End
19:59:00 Check_GlobalVariableSetOnCondition() GBPUSD,M1: GBPUSD Start
19:59:00 Check_GlobalVariableSetOnCondition() GBPUSD,M1: GBPUSD End
19:59:00 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD Start
19:59:01 Check_GlobalVariableSetOnCondition() USDCAD,M1: USDCAD End


Once again, just in case for those in a tank in a submarine and still wearing a helmet. Only atomic access is shown here. The order of functions working will be as the wind blows. This code does not provide for uniform execution of functions. That's why there is no guarantee that a function won't stay on the shelf for a very long time. Relying on serviceability in programming only because the processor's frequency is high is ridiculous, even if the processor's frequency is very high.