This chapter is an introduction to concurrency and how Kotlin approaches concurrency challenges. In this chapter, we will also take a first look at asynchronous code written using coroutines. It's important to mention that while the keywords, primitives, and functions related to concurrency in pure Kotlin will be explained through the book, some knowledge of Kotlin is required in order to be able to fully comprehend the code examples.
The following topics will be covered in this chapter:
- Processes, threads, coroutines, and their relationships
- Introduction to concurrency
- Concurrency versus parallelism
- CPU-bound and I/O-bound algorithms
- Why concurrency is often feared
- Concurrency in Kotlin
- Concepts and terminology