I have a question about concurrency in flows.
It seems to work, almost, as I expected...
This Flow
It waits for both threads... Then continues, but continues twice. Shouldn't it just wait and then resume as a single thread?
Concurrency in flow question
Moderator: Martin
Re: Concurrency in flow question
Hi,
The image can not be loaded for me. Could you please share the flow or upload the image again?
Regards,
Martin
The image can not be loaded for me. Could you please share the flow or upload the image again?
Regards,
Martin
Re: Concurrency in flow question
Attached.
Thank you.
Thank you.
- Attachments
-
- concurrencyTest.7z
- (921 Bytes) Downloaded 679 times
Re: Concurrency in flow question
It is working already as expected. If you rejoin the flow after you split it, the flow now have 2 "threads" running. If you want only single, you must disconnect one of them. Or you can rejoin both thread by using condition execution count, set to 2.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Concurrency in flow question
Thanks. I mistook the fact that it Waits for both threads to complete before moving on to mean the threads rejoined to one. What is interesting is it doesn't always result in everything being run multiple times...
Cheers,
-josh
Thank you. I'll have look for that. Discover new things all the time...using condition execution count, set to 2.
Cheers,
-josh
Re: Concurrency in flow question
The parallel threading there cause the other part of the thread to wait. It is useful in some cases, where you input dialog to stay or do something there. But we usually use parallel design when combined with condition, as I pointed out in mutliple parallel expression; which allow you to combine multiple one=trick pony flows to a single flow with many triggers. viewtopic.php?f=5&t=6882
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Concurrency in flow question
I get it... But, it's curious how sometimes it continues as two threads, but other times it results in a single thread again...
Re: Concurrency in flow question
At mine, it is mostly two threads. But maybe I haven't tried it long enough to encounter the single thread result. Maybe this is related with your other thread question. I will continue there instead.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.