Show HN: I'm writing an interactive book on Go concurrency
Anton Zhiyanov's interactive book teaches Go concurrency through 44 practical exercises, covering goroutines, channels, and synchronization. Currently in progress, it aims for completion by late 2024, with online access available.
Read original articleAnton Zhiyanov has created an interactive book focused on teaching Go concurrency through practical exercises, aimed at programmers already familiar with the Go language. The book emphasizes understanding and applying concurrency primitives rather than just theoretical knowledge. It includes 44 interactive exercises that can be solved with minimal code and are designed to reflect real-world scenarios. The content covers essential topics such as goroutines, channels, synchronization techniques, and data races, structured into two main parts: concurrency basics and synchronization. Each exercise comes with a reference solution and explanation, facilitating a hands-on learning experience. The book is currently a work in progress, with two out of twelve chapters completed, and is expected to be fully published by the end of 2024. Readers can access the chapters online or purchase the book for full access, including a PDF version. Zhiyanov, a Go developer and SQLite enthusiast, previously launched a successful course on Go concurrency, which has received high ratings from students. The book is based on this course, aiming to provide a clear and engaging approach to concurrent programming in Go.
Related
Three ways to think about Go channels
Channels in Golang are locked, buffered queues for message passing. They integrate with goroutines, select blocks, and more, offering efficient concurrency. Understanding their role and benefits is crucial for Golang developers.
Atomic Operations Composition in Go
The article discusses atomic operations composition in Go, crucial for predictable results in concurrent programming without locks. Examples show both reliable and unpredictable outcomes, cautioning about atomics' limitations compared to mutexes.
Properly Testing Concurrent Data Structures
The article explores testing concurrent data structures using the Rust library loom. It demonstrates creating property tests with managed threads to simulate concurrent behavior, emphasizing synchronization challenges and design considerations.
Coroutines in Go: Runtime Implementation and Iterators
Go 1.22 introduced coroutines, enhancing concurrency by allowing functions to pause and resume execution. This model simplifies code, improves efficiency, and reduces context-switching costs compared to traditional goroutines.
Rust for Rustaceans
"Rust for Rustaceans" by Jon Gjengset is a book for developers with basic Rust knowledge, focusing on advanced topics, codebases, and programming challenges, praised for clarity but noted for its density.
Related
Three ways to think about Go channels
Channels in Golang are locked, buffered queues for message passing. They integrate with goroutines, select blocks, and more, offering efficient concurrency. Understanding their role and benefits is crucial for Golang developers.
Atomic Operations Composition in Go
The article discusses atomic operations composition in Go, crucial for predictable results in concurrent programming without locks. Examples show both reliable and unpredictable outcomes, cautioning about atomics' limitations compared to mutexes.
Properly Testing Concurrent Data Structures
The article explores testing concurrent data structures using the Rust library loom. It demonstrates creating property tests with managed threads to simulate concurrent behavior, emphasizing synchronization challenges and design considerations.
Coroutines in Go: Runtime Implementation and Iterators
Go 1.22 introduced coroutines, enhancing concurrency by allowing functions to pause and resume execution. This model simplifies code, improves efficiency, and reduces context-switching costs compared to traditional goroutines.
Rust for Rustaceans
"Rust for Rustaceans" by Jon Gjengset is a book for developers with basic Rust knowledge, focusing on advanced topics, codebases, and programming challenges, praised for clarity but noted for its density.