streetsofboston
12/12/2018, 8:55 PM<http://Dispatchers.IO|Dispatchers.IO> which is backed by a pool of threads, let’s say “Thread-1” through “Thread-64".
When a suspension point in a suspend function is reached while running in “Thread-4”, does the function always resume in the same thread, “Thread-4", or could it resume in any of the other threads of the thread-pool of <http://Dispatchers.IO|Dispatchers.IO> (it could be “Thread-35”)?
I think it is the last option (could be in the other threads of the dispatcher), but I’m not sure … 🙂danny
12/12/2018, 9:25 PMkotlinx.coroutines.scheduling.CoroutineScheduler goes into that a little - looks to me that the transition from non-blocking to blocking would always retain affinity, but the task would be stolen and executed on another thread if it couldn't regain a CPU permit in within WORK_STEALING_TIME_RESOLUTION_NSstreetsofboston
12/12/2018, 9:26 PMdanny
12/12/2018, 9:29 PM