Gist of Go: Concurrency

Many Go concurrency books and tutorials are like: here's goroutine, here's channel, here's select — use them as you like. Others just throw concurrent patterns at you without really explaining them.

This is not very helpful: the most important thing in concurrent programming is not pure knowledge, but the understanding and ability to apply concurrency primitives.

That's why I've created an interactive book that teaches Go concurrency from the ground up through practical exercises. These exercises are simple enough to be solved with a single page of code yet are closely aligned with real-world scenarios.

Audience and approachContentsAbout the author

Audience and approach

The book is intended for programmers who are already familiar with Go, from language basics to interfaces and errors. You don't need any prior knowledge of goroutines and channels — we'll cover concurrency tools from the ground up.

Since the book targets experienced programmers, I've chosen a presentation style that I prefer: concise, focused, with exercises of moderate difficulty. Maybe you'll like it too.

Concurrent programming is a tricky beast, but I explain complex topics clearly, making them easier to understand. There are lots of examples and no dry theory.

There are 44 interactive exercises that run directly in the browser. Each problem has a reference solution with an explanation.

The book uses Go version 1.22.

Contents

Part 1. Concurrency basics

Part 2. Synchronization

  • Wait groups
  • Data races
  • Race conditions
  • Semaphores
  • Signaling
  • Atomics
  • Internals
  • Summary

You can read the chapters using the links in the table of contents above, or purchase the book for full access to the interactive exercises (+ a PDF version).

The book is a work in progress (2/12 chapters finished). All chapters will be published by the end of 2024.

Pre-order for $10   or read online

About the author

I'm Anton Zhiyanov, Go developer and SQLite enthusiast. I work on open source and write about programming.

In 2022 I launched a course on Go concurrency. It now has 250 graduates and an average rating of 5 stars based on 100 student reviews.

This book is based on the original course.

★ Subscribe to keep up with new posts.