Chapter 8: Designing for Concurrency
Concurrent design patterns help us to manage many tasks at once and structure their life cycle. By using these patterns efficiently, we can avoid problems such as resource leaks and deadlocks.
In this chapter, we'll discuss concurrent design patterns and how they are implemented in Kotlin. To do this, we'll be using the building blocks from previous chapters: coroutines, channels, flows, and concepts from functional programming.
We will be covering the following topics in this chapter:
- Deferred value
- Barrier
- Scheduler
- Pipeline
- Fan out
- Fan in
- Racing
- Mutex
- Sidekick channel
After completing this chapter, you'll be able to work with asynchronous values efficiently, coordinate the work of different coroutines, ...
Get Kotlin Design Patterns and Best Practices - Second Edition 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.