Concurrency in Rust: A Practical Guide
300 pages
English
PDF
4.5

Concurrency in Rust: A Practical Guide

Concurrency in Rust: A Practical Guide

Author:

Year:

Summary:

The book "Concurrency in Rust" is a comprehensive guide to one of the most powerful and complex topics in the Rust language. The author, experienced systems programmer Artyom Sokolov, will take you step by step from basic concepts to advanced parallel programming techniques.



Rust, with its ownership system and types, guarantees memory safety at compile time, and this makes concurrency in it unique. You will learn how to write code that is simultaneously fast, scalable, and free of data races — errors that plague developers in C++ and Java.



What you will learn:

  • Concurrency basics: threads (std::thread), closures, transferring ownership between threads.
  • Data sharing: channels (mpsc), mutexes (Mutex, RwLock), atomic types (AtomicBool, AtomicUsize).
  • Smart pointers for multithreading: Arc, MutexGuard, RwLock and their correct usage.
  • Asynchronous programming: async/await, futures, streams, executor (tokio, async-std).
  • Advanced patterns: thread pools, work-stealing, barriers, semaphores, condition variables.
  • Safety and testing: detecting data races with loom, testing asynchronous code.


Who this book is for:

  • Rust developers who have mastered the basics and want to write high-performance parallel applications.
  • Systems programmers migrating from C/C++ who want to eliminate memory headaches.
  • Backend engineers working with network services, databases, or high-load systems.
  • Anyone interested in modern approaches to concurrency and wanting to understand the philosophy of Rust.


The book contains many practical examples, from simple multithreaded calculators to full-fledged asynchronous web servers. Each chapter ends with exercises to reinforce the material. You will learn not only how to write code but also how to debug it — the author shares techniques for profiling and finding bottlenecks.



"Concurrency in Rust" will become your reliable companion in mastering the parallel world. Whether you are building a high-load API, processing real-time data streams, or simply want to understand how modern concurrency works — this book is for you.



Dive into Rust and discover a paradigm where speed and safety go hand in hand.

Recommendations