Summary

In this chapter, we discussed the foundations of Rust concurrency—Sync and Send. Furthermore, we started on what makes a primitive thread-safe in Rust and how to build concurrent structures with those primitives. We reasoned through an improperly synchronized program, showing how knowledge of the Rust memory model, augmented by tools such as helgrind, allow us to determine what's gone sideways in our programs. This is, perhaps unsurprisingly to the reader, a painstaking process that is, like as not, prone to error. In Chapter 5, Locks – Mutex, Condvar, Barriers and RWLock, we'll discuss the higher-level coarse synchronization primitives that Rust exposes to the programmer. In Chapter 6, Atomics – the Primitives of Synchronization ...

Get Hands-On Concurrency with Rust 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.