Concurrency in Java: A Practical Guide to Multithreaded Programming
300 pages
English
PDF
4.5

Concurrency in Java: A Practical Guide to Multithreaded Programming

Concurrency in Java: A Practical Guide to Multithreaded Programming

Author:

Year:

Summary:

The book "Concurrency in Java" is a comprehensive practical guide to writing efficient, safe, and scalable multithreaded applications in Java. The author, Alexey Smirnov, a senior developer with 10 years of experience, consistently guides the reader from classical approaches (Thread, Runnable) to modern tools (CompletableFuture, Project Loom virtual threads).



The material is structured on the principle of "from simple to complex": each chapter contains theory, code examples, typical mistakes, and their solutions. Special attention is paid to practical aspects: you will learn not only to write multithreaded code but also to debug it, profile it, and avoid "hellish" problems like deadlock, livelock, and race conditions.



Who is this book for?

  • Junior Java developers — will master the basics: creating threads, synchronization, wait/notify.
  • Middle developers — will deepen their knowledge: thread pools, Fork/Join, parallel Stream API.
  • Anyone transitioning from Java 8 to newer versions (11, 17, 21+) — will understand CompletableFuture and virtual threads.


What will you learn?

  • How threads work in the JVM and the operating system.
  • Synchronization rules: synchronized, Lock, Semaphore, CountDownLatch.
  • Safe collections from java.util.concurrent.
  • ExecutorService and custom thread pools.
  • Asynchronous programming with CompletableFuture.
  • The newest mechanism of virtual threads (Project Loom) — how and when to use them.
  • Testing multithreaded code with JUnit and jcstress.


The book is written in a lively language, without excessive academicism. Each example can be immediately run and modified. At the end of the chapters, there are self-test questions and practical assignments.



This is a desk book for any Java developer who wants to write fast, reliable, and scalable applications. Whether you are building a high-load server, a desktop application, or processing Big Data, knowledge of concurrency is a mandatory skill.



After reading, you will be able to confidently design multithreaded systems, avoid typical pitfalls, and efficiently use all processor cores.

Recommendations