aboutsummaryrefslogtreecommitdiffstats
path: root/kotlinx-coroutines-core/jvm
diff options
context:
space:
mode:
authorVsevolod Tolstopyatov <qwwdfsad@gmail.com>2020-10-08 02:00:38 -0700
committerGitHub <noreply@github.com>2020-10-08 12:00:38 +0300
commitd4c55ce63403737b8aacf7df9410ce5374dc3786 (patch)
tree5c02d6c570247583985f126ba31d6b87724a2391 /kotlinx-coroutines-core/jvm
parent3af136f9452ac5ff1c22657265d4b9e5e508ab71 (diff)
downloadplatform_external_kotlinx.coroutines-d4c55ce63403737b8aacf7df9410ce5374dc3786.tar.gz
platform_external_kotlinx.coroutines-d4c55ce63403737b8aacf7df9410ce5374dc3786.tar.bz2
platform_external_kotlinx.coroutines-d4c55ce63403737b8aacf7df9410ce5374dc3786.zip
Clarify documentation for IO dispatcher (#2286)
Fixes #2272
Diffstat (limited to 'kotlinx-coroutines-core/jvm')
-rw-r--r--kotlinx-coroutines-core/jvm/src/Dispatchers.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/kotlinx-coroutines-core/jvm/src/Dispatchers.kt b/kotlinx-coroutines-core/jvm/src/Dispatchers.kt
index 8cd3bb1b..8033fb38 100644
--- a/kotlinx-coroutines-core/jvm/src/Dispatchers.kt
+++ b/kotlinx-coroutines-core/jvm/src/Dispatchers.kt
@@ -97,7 +97,7 @@ public actual object Dispatchers {
* The [CoroutineDispatcher] that is designed for offloading blocking IO tasks to a shared pool of threads.
*
* Additional threads in this pool are created and are shutdown on demand.
- * The number of threads used by this dispatcher is limited by the value of
+ * The number of threads used by tasks in this dispatcher is limited by the value of
* "`kotlinx.coroutines.io.parallelism`" ([IO_PARALLELISM_PROPERTY_NAME]) system property.
* It defaults to the limit of 64 threads or the number of cores (whichever is larger).
*
@@ -106,9 +106,13 @@ public actual object Dispatchers {
* If you need a higher number of parallel threads,
* you should use a custom dispatcher backed by your own thread pool.
*
+ * ### Implementation note
+ *
* This dispatcher shares threads with a [Default][Dispatchers.Default] dispatcher, so using
* `withContext(Dispatchers.IO) { ... }` does not lead to an actual switching to another thread &mdash;
* typically execution continues in the same thread.
+ * As a result of thread sharing, more than 64 (default parallelism) threads can be created (but not used)
+ * during operations over IO dispatcher.
*/
@JvmStatic
public val IO: CoroutineDispatcher = DefaultScheduler.IO