Schedulers.computation() - CPU bound schedulers

The Schedulers.computation() is probably the most useful scheduler for programmers. It provides us with a bounded thread-pool, which can contain a number of threads equal to the number of available CPU cores. As the name suggests, this scheduler is meant for CPU intense works.

We should use this scheduler only for CPU—intense tasks and not for any other cause. The reason is that the threads in this scheduler keeps the CPU cores busy, and may slow down the entire application if it is used for I/O bound or any other tasks that involves non-computational tasks.

The main reason why we should consider Schedulers.io() for I/O bound tasks and Schedulers.computation() for computational purposes is that ...

Get Reactive Programming in Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.