https://kotlinlang.org logo
#coroutines
Title
# coroutines
e

Eric Womer

01/25/2023, 11:58 AM
I have this ugly code that is suppsed to dived the number of jobs (count) up by the number of processors (cores) and do work via asyncs and for loops with the last remainder being on its own async later in the code, the problem is randomly inside the first for loop async is called twice, https://gist.github.com/ericwomer/8921f3123392a9451ac89a4957c3ebbd
s

Sam

01/25/2023, 12:14 PM
Avoid using shared mutable variables inside an
async
block. The changing value of
forCount
might well be causing unexpected results for you.
3 Views