From b8f44622fcc7006d560eecdc5baf21e5edce2f0d Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Tue, 5 Apr 2022 17:38:37 +0300 Subject: [PATCH] Dispatchers.IO doc clarification Addresses #3234 --- kotlinx-coroutines-core/jvm/src/Dispatchers.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kotlinx-coroutines-core/jvm/src/Dispatchers.kt b/kotlinx-coroutines-core/jvm/src/Dispatchers.kt index 4b1b03337d..251a567c54 100644 --- a/kotlinx-coroutines-core/jvm/src/Dispatchers.kt +++ b/kotlinx-coroutines-core/jvm/src/Dispatchers.kt @@ -125,8 +125,9 @@ public actual object Dispatchers { * * This dispatcher and its views share threads with the [Default][Dispatchers.Default] dispatcher, so using * `withContext(Dispatchers.IO) { ... }` when already running on the [Default][Dispatchers.Default] - * dispatcher does not lead to an actual switching to another thread — typically execution - * continues in the same thread. + * dispatcher typically does not lead to an actual switching to another thread. In such scenarios, + * the underlying implementation attempts to keep the execution on the same thread on a best-effort basis. + * * As a result of thread sharing, more than 64 (default parallelism) threads can be created (but not used) * during operations over IO dispatcher. */