@@ -25,7 +25,7 @@ public actual object Dispatchers {
2525 * The [CoroutineDispatcher] that is designed for offloading blocking IO tasks to a shared pool of threads.
2626 *
2727 * Additional threads in this pool are created and are shutdown on demand.
28- * The number of threads used by tasks in this dispatcher is limited by the value of
28+ * The number of threads doing IO work in parallel is limited by the value of
2929 * "`kotlinx.coroutines.io.parallelism`" ([IO_PARALLELISM_PROPERTY_NAME]) system property.
3030 * It defaults to the limit of 64 threads or the number of cores (whichever is larger).
3131 *
@@ -46,19 +46,20 @@ public actual object Dispatchers {
4646 * // 60 threads for MongoDB connection
4747 * val myMongoDbDispatcher = Dispatchers.IO.limitedParallelism(60)
4848 * ```
49- * the system may have up to `64 + 100 + 60` threads dedicated to blocking tasks during peak loads,
49+ * the system may have up to `64 + 100 + 60` threads running blocking tasks in parallel during peak loads,
5050 * but during its steady state there is only a small number of threads shared
5151 * among `Dispatchers.IO`, `myMysqlDbDispatcher` and `myMongoDbDispatcher`.
5252 *
53- * ### Implementation note
53+ * ### Implementation notes
5454 *
5555 * This dispatcher and its views share threads with the [Default][Dispatchers.Default] dispatcher, so using
5656 * `withContext(Dispatchers.IO) { ... }` when already running on the [Default][Dispatchers.Default]
5757 * dispatcher typically does not lead to an actual switching to another thread. In such scenarios,
5858 * the underlying implementation attempts to keep the execution on the same thread on a best-effort basis.
5959 *
60- * As a result of thread sharing, more than 64 (default parallelism) threads can be created (but not used)
61- * during operations over IO dispatcher.
60+ * The limit on the number of blocking tasks running in parallel is *not* a strict limit on the number of threads.
61+ * It is possible for more thread than the limit to exist at the same time, but the extra threads are guaranteed
62+ * to be in their start-up or shutdown phases and not actually executing work.
6263 */
6364 @JvmStatic
6465 public val IO : CoroutineDispatcher get() = DefaultIoScheduler
0 commit comments