a command to terminate any other running copies/treads of the Macro inside the Macro

GamBIT

New member
Hello!
It is now that if a trigger has launched the Macro while it is already running (by the other trigger, for example), then there will be launched a new copy of the same macro. If the previous copy is still running in a cycle, then there will be 2 copies in memory, running simultaneously and in conflict. And it may be a problem!
Now I have to make some other 'starting' macro, that firstly terminates/stopes the running macro and relaunches it again, since the macro cannot terminate self-copies and continue running. It is very unpleasant.
I suggest to make a command to terminate any running previous copies of the macro and continue working So we could use this command at the very beginning of the macro to ensure that no other copy of the same macro is running at the same time. I think it could be done as an option of 'stay running' for the present command of stopping the macro. Now it terminates all the copies, including that has it invoked.
Thanks.
 

hsurB

Well-known member
Isn't it something that can be fixed by constraint [This macro] not runing?
Or by starting macro with Cancel macro actions - [This macro]
Depends on what effect you want to achieve - prioritise already runing macro or new one
 

hsurB

Well-known member
Sorry. Just edited a post so you might have missed the rest. You could try cancel macro actions as well
 
Last edited:

hsurB

Well-known member
In this case I think the macro will always end with the first action.

Yeah you are right. Its way more annyoing than I was expecting.
Even using run other macro at the start to cancel main macro actions and use action run macro (main one) in the second one shortly after (with constrain macro not invoked in last few seconds on entire macro to prevent from runing in loop) is still not reliable enough.
Maybe somehow with variables 🤔 That would also require having at least few macros, runing each time different and cancelling these that are already runing.
Depedning on how often macro is triggered it might require more macros
 

GamBIT

New member
As I wrote before, ' since the macro cannot terminate self-copies and continue running. ' 'Cancel macro actions' command stops all the copies and self too. So it isn't a solution.
I have bumped into this problem many times before and has solved this problem only with a lot of auxiliary macros, and this is not right, I think.
Moreover, now I place a 'Cancel macro actions' command at the end of macro and at some other points to ensure that macro will not be 'lost in memory', running, it some trigger calls a new one. I had to create a dispatch macro to control the other macros. And now the are a lot of macros instead of the one.
The problem is that there's nowhere said that if a trigger invokes some macro, the previous copy will NOT be terminated automatically. I have spent a lot of time trying to understand what's happening, why VARs do something wrong etc., while have noticed that there are a lot of copies running at the same time. Not the only the last instance.
So I guess it would be VERY useful to have a command to terminate ALL the other copies EXCEPT copy called this command.
 

GamBIT

New member
Imagine the following.
You are creating a macro that is monitoring smth and runs in a cycle. And You have a set of triggers. You cannot know which trigger and when will be switched and start a new copy. And you cannon use a 'Cancel macro actions' at the beginning since it would terminate your macro. And that's a problem now. The macro's logic doesn't expect a presence of unknown set of previous copies that are running and conflict each other.
Of course, it you have a deal only with a very short-time living macros, you would not notice any problem. Since all the time macro is not active and is only waiting a trigger. But if it runs, it would be a problem as it would not be terminated when a trigger will launch the macro as a new thread.
Of course you may invent some ways to communicate the copies via some VARs and make them self-terminate if they fill the presence of the others, but ... why?
Isn't it a better way to give a programmer a command to terminate the other copies?
 
Last edited:
Top