January 2022
Intermediate to advanced
356 pages
6h 9m
English
In the previous chapter, we had a glance at how our application can efficiently serve thousands of requests per second—to discuss why immutability is important, we introduced a race condition problem using two threads.
In this chapter, we'll dive deeper into how to launch new threads in Kotlin and the reasons why coroutines can scale much better than threads. We will discuss how the Kotlin compiler treats coroutines and the relationship between coroutine scopes and dispatchers. We'll discuss the concept of structured concurrency, and how it helps us prevent resource leaks in our programs.
We'll cover the following topics in this chapter:
Read now
Unlock full access