Loading lesson…
Level 1 · Apprentice0 XP
suspend functions become state machines; dispatchers put them back on threads.
Step 1 / 6
ProblemYou launch 100,000 coroutines that each wait one second. It works with a handful of threads. 100,000 threads would need gigabytes. How?
← → step
Before this: Deep dive: LiveData.postValue, top to bottom
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Launch 100,000 coroutines that each delay(1000) and finish in about one second. Then try the same with 100,000 threads using Thread.sleep and compare memory and time (stop if it gets too slow). Finally, decompile a suspend function and find the label field.