concurrency model

Post your questions and help other users.

Moderator: Martin

Post Reply
lexelby
Posts: 16
Joined: 15 Oct 2015 00:35

concurrency model

Post by lexelby » 17 Oct 2015 00:26

What concurrency model does automagic use?

I'm considering switching from tasker after years of use. Automagic looks like a pretty strong competitor with some desirable new features.

The biggest reason I want to leave tasker is its multitasking support -- or lack thereof. Only one action can run at a time, and sometimes if multiple tasks are doing Wait actions, nothing else can run. It's like all of tasker freezes up. There've been some bugfixes around this but problems persist, making me think the underlying algorithms are problematic.

Does automagic support true multitasking? I've done some tests that make me think it does, but I'd like to hear from you if possible, Martin. I've seen that inside one flow, only one action can run at a time, even if the logic branches, and I'm okay with that. It seems like separate flows don't interfere though -- is this correct?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: concurrency model

Post by Martin » 17 Oct 2015 18:42

Hi,

Different flows are executed independently in general, except for action Script to avoid concurrency problems with global variables. This should usually not be a problem or even noticeable except when you create scripts that use a long time to execute.

Regards,
Martin

lexelby
Posts: 16
Joined: 15 Oct 2015 00:35

Re: concurrency model

Post by lexelby » 17 Oct 2015 19:08

Awesome! I can work with that. To clarify, an entire script block is run while holding a mutex? So I can work around it by breaking a script up if need be as a way of "yielding"?

lexelby
Posts: 16
Joined: 15 Oct 2015 00:35

Re: concurrency model

Post by lexelby » 17 Oct 2015 19:10

Oh, and does Script prevent execution of all other actions, or just other Scripts?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: concurrency model

Post by Martin » 18 Oct 2015 09:56

Exactly, splitting the script into multiple scripts could be done but I recommend to keep scripts short and fast so it should not be noticeable at all. Other actions should not be blocked, except condition Expression which is mostly the same as a regular action Script.

lexelby
Posts: 16
Joined: 15 Oct 2015 00:35

Re: concurrency model

Post by lexelby » 18 Oct 2015 13:51

Awesome, that's exactly the detail I needed. Thanks! Now, to translate 4 years' worth of tasker profiles ;)

Post Reply