-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Kotlin Design Patterns and Best Practices
By :

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:
After reading this chapter, you'll be familiar with Kotlin's concurrency primitives...