Concurrency Techniques in Kotlin
260 pages
English
PDF
4.5

Concurrency Techniques in Kotlin

Concurrency Techniques in Kotlin

Author:

Year:

Summary:

Introduction

The book "Concurrency Techniques in Kotlin" by A. Foster, published in 2021, is a comprehensive guide to working with concurrency in the Kotlin language. In the era of multi-core processors and performance-demanding applications, the ability to skillfully manage parallel computations is becoming critically important. The author consistently guides the reader from basic concepts to advanced techniques, using modern Kotlin features, including coroutines, threads, and channels.

What the book is about

The book covers all key aspects of concurrent programming in Kotlin. The first part is devoted to the basics: the differences between parallelism and concurrency, memory models, and the problems of data races and locks. The author then moves on to practical tools — from traditional Java threads to native Kotlin coroutines. Special attention is paid to the kotlinx.coroutines library, its dispatchers, scopes, and structured concurrency. The second half of the book examines advanced topics: channels for data exchange between coroutines, Flow for reactive streams, testing concurrent code, and integration with Android frameworks.

Who this book is for

The book is aimed at developers already familiar with the basics of Kotlin who wish to deepen their knowledge in the field of multithreading. It will be useful for:

  • Android developers striving to write responsive and fast applications;
  • Backend engineers working with server-side Kotlin (Ktor, Spring);
  • Programmers transitioning from Java to Kotlin and wanting to master its asynchronous capabilities;
  • Students and enthusiasts studying modern approaches to concurrency.

What the reader will learn

After reading the book, the reader will be able to:

  • Understand the fundamental principles of concurrency and parallelism;
  • Use coroutines for asynchronous operations without blocking threads;
  • Apply dispatchers and scopes to control coroutine execution;
  • Implement safe data exchange via channels and Flow;
  • Avoid common mistakes: deadlock, race conditions, memory leaks;
  • Test concurrent code using special Kotlin utilities;
  • Integrate coroutines into Android applications with lifecycle awareness.

Strengths

The main advantage of the book is its practical focus. Each chapter contains numerous code examples that can be tried out immediately. The author does not just list APIs, but explains why one should choose a particular approach. The chapters on structured concurrency and testing deserve special mention — these topics are rarely covered in such detail. The book is written in a lively style, with complex concepts illustrated by clear diagrams. Despite its modest size (260 pages), the material covers all necessary topics without unnecessary filler.

Who it is recommended for

I strongly recommend this book to anyone who writes in Kotlin and wants to take their skills to the next level. It will be an excellent addition to the official documentation and will help systematize knowledge. For beginners in concurrency, the book will serve as a reliable starting point, while experienced developers will find fresh ideas and best practices. If you aim to create fast, responsive, and scalable applications — this book is for you.

Recommendations