Simple Exercise

OscariBot

Active member
Question...

1) If I have two identical macro triggered at the same time, will both run at the same time? "parallel" or will one wait for the other to complete before it run? "serial". (assuming processing time is 1min)

2) Which of the above execution will be faster? Parallel or Serial.

This is really important for all macrodroid user to try....

Let's compare our results.
 

Endercraft

Moderator (& bug finder :D)
Question...

1) If I have two identical macro triggered at the same time, will both run at the same time? "parallel" or will one wait for the other to complete before it run? "serial". (assuming processing time is 1min)

2) Which of the above execution will be faster? Parallel or Serial.

This is really important for all macrodroid user to try....

Let's compare our results.
Serial. Macros have a way of order making one always trigger before the other. They are processed in serial (unless a wait of any kind is executed in which case the other waiting macro then runs), but not at the same time. I'm not sure how the system attributes which macro triggers in first.
 

MacroDroidDev

Administrator
Staff member
So the macros will run in serial if they are very simple, but there are many actions that work asynchronously (or have the option to do so), so in this case the second macro will begin running in parallel.
 

Endercraft

Moderator (& bug finder :D)
So the macros will run in serial if they are very simple, but there are many actions that work asynchronously (or have the option to do so), so in this case the second macro will begin running in parallel.
I'm not sure how the system attributes which macro triggers in first.
I wanted to know how does MacroDroid decides which macro would run in first. I have tested and I know that one macro will always run before/after another if triggered at the same time/trigger.
 

MacroDroidDev

Administrator
Staff member
I believe it should be a simple case of whichever one was created first will be first in the list to be checked, but I may be wrong about this.
 

Dm114

Well-known member
So the macros will run in serial if they are very simple, but there are many actions that work asynchronously (or have the option to do so), so in this case the second macro will begin running in parallel.
Do you mean that several macros can fire at the same time if they have same triggers?

As far as I remember, we were told (a few years ago 😉) that the result could be unpredictable. So I gathered all my main triggers (sorted in the alphabetical order) in one macro (to avoid multiple identical triggers) and run appropriate macro from this main one. Am I wrong or is it useless now?
 

OscariBot

Active member
So the macros will run in serial if they are very simple, but there are many actions that work asynchronously (or have the option to do so), so in this case the second macro will begin running in parallel.

I never expected the "b" part of the answer... All macros seems to run in series not minding wether it's identical or not. Except a Wait Action is added just like @Endercraft explained above.

So what are the options to invoke asynchronously behavior....

A simple explanation with macro will be appreciated.


So the macros will run in serial if they are very simple, but there are many actions that work asynchronously (or have the option to do so), so in this case the second macro will begin running in parallel.
 

OscariBot

Active member
Most time i really wish I could run my macro in parallel... Though I knw running in series have great advantage.
 

OscariBot

Active member
I believe it should be a simple case of whichever one was created first will be first in the list to be checked, but I may be wrong about this.
I really play around this to find out why which macro triggers first, no luck, it's still mysterious, but one thing is obvious, It never followed the rules of running the macro that was created first like you suggested.
 

OscariBot

Active member
While playing around this afternoon, something caught my attention.. am curious what is the purpose of the check box with title "Block Next Action Untill Completed"
It makes me wonder if macrodroid truly run in series why then do we have to block next action until one is completed. Ofcouse series means "A" will run before "B".

I am still trying to figure it out.
 

dhj49er

Well-known member
While playing around this afternoon, something caught my attention.. am curious what is the purpose of the check box with title "Block Next Action Untill Completed"
It makes me wonder if macrodroid truly run in series why then do we have to block next action until one is completed. Ofcouse series means "A" will run before "B".

I am still trying to figure it out.
I found the way Macrodroid "works" by observing the way it handles options such as the block next action until completed and wait for triggers on multiple macros with many having asynchronous events like devices connected/disconnected.
The system log is your friend - I always check and analyse macro actions, especially if the macros aren't working the way I want.
Macrodroid executes one action at a time, not necessarily completing one macro before starting the next macro.
The block next action until completed when enabled ensures the calling macro is executed completely before the action following the macro run action is executed. If disabled the system log would show the actions from the 2 macros interleaved.
The wait for trigger is a good way of controlling macro execution - pausing the current macro until the trigger fires.
 
Top