parallel execution

dsnz

Well-known member
hello,

I would like to know what happens in the following scenario (which unfortunately I can't simulate properly until now)

suppose macro A calls B periodically
and suppose by chance it happens that sometime B is slow enough that A calls B again !

then what happens ? I can think of these outcomes

- both "instances" of B run in parallel
- the second instance of B waits until the first one finishes and then executes normally
- everything crashes !

ps. I already know that many macros can be triggered simultaneously and run in parallel but what I describe above is different

thanks
 

Dm114

Well-known member
hello,

I would like to know what happens in the following scenario (which unfortunately I can't simulate properly until now)

suppose macro A calls B periodically
and suppose by chance it happens that sometime B is slow enough that A calls B again !

then what happens ? I can think of these outcomes

- both "instances" of B run in parallel
- the second instance of B waits until the first one finishes and then executes normally
- everything crashes !

ps. I already know that many macros can be triggered simultaneously and run in parallel but what I describe above is different

thanks
You can check the 'Wait to complete...' box in the 'Macro run' action (while launching macro B) or use a global variable to store the running macros. Here is what I sometimes use:
Macro A:
:
A: Wait untill [v=RUN] doesn't contain '<Macro B>'
A: Wait 250 or 500 ms
A: Loop
A: Run Macro B
:

Macro B :
A (first line): [v=RUN]=[v=RUN]<[macro_name]>
:
:
A (last line): regex replace in [v=RUN], '<[macro_name]>' by ' ' (empty string)
 
Top