I use `mutableStateListOf().parallelStream().forEa...
# compose
k
I use
mutableStateListOf().parallelStream().forEach {}
and coroutines to execute the items in parallel, but it seems some executions won't be run. And the missing executions are random. Is there a solution?
a
What more specifically are you trying to do?
k
I try to load images, and then pass it to Image()
As you can see, some images won't be displayed
a
Can you post the code surrounding that snippet?
k
Yeah, wait a minute
I load songs without icons at first, then copy icons to every song.
Emmm, the result is "30 : 29 : 29"
z
The biggest red flag here is that you’re using mutable state in multiple threads, which is likely to cause weird data inconsistency bugs like you’ve described.
k
What should I do? Use Kotlin Flow?