Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions kotlinx-coroutines-core/jvm/src/Dispatchers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ public actual object Dispatchers {
* 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.
* Whenever we are talking about the number of IO threads in the pool being limited by some number,
* that only means that at most that many threads are going to *actually perform* IO work in parallel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly make it more formal, by getting rid of "we"

"The number of IO threads is at most N" means that at most N threads...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked your suggestion in principle, but didn't think of a way to clearly incorporate it, so I reworded the KDoc to improve accuracy. Since this is an extensive change, please take a look again.

* It is still possible to observe more threads than that, but those threads are guaranteed to be in their
* start-up or shutdown phases.
*/
@JvmStatic
public val IO: CoroutineDispatcher get() = DefaultIoScheduler
Expand Down