With
limitedParallelism, you can create a view of a dispatcher, that limits the number of coroutines running in parallel to the given number. So, e.g.
Dispatchers.IO.limitedParallelism(4)
returns a dispatcher that uses the IO dispatcher, but runs at most 4 coroutines at the same time. Of course the number of parallelism could never be higher than the number of threads in the original Dispatcher (e.g. a single-threaded dispatcher with a parallelism of 4 makes no sense). Note that calling this function does not change the original dispatcher (IO in this case).
The
IO_PARALLELISM_PROPERTY_NAME sets the system-wide maximum number of threads used by
<http://Dispatchers.IO|Dispatchers.IO>
, so that applies to the IO dispatcher itself. Note that this is a JVM property only, if I am not mistaken.