Personal notes on the book "Concurrency in Go" by Katherine Cox-Buday. Reference: Katherine Cox-Buday. Concurrency in Go: Tools and Techniques for Developers. O'Reilly Media, 2017.
Table of Contents
- Concurrency Semantics
- Communicating Sequential Processes
- Concurrency Building Blocks (in Go)
- Concurrency Patterns (in Go)
- Concurrency at Scale
- Goroutines and the Go Runtime
- "Concurrency", "asynchronous", "parallel", and "threaded" are distinct concepts
- A process is considered concurrent if it occurs simultaneously with one or more other processes
- Amdahl's Law models potential performance gains from implementing solutions in a parallel manner
- It helps determine whether parallelization is an effective strategy for addressing performance concerns in a system
- Gains are limited by the portion of the program that must be executed sequentially
- Evaluate whether significant performance improvements can be achieved by simply increasing the number of cores available to your program
- Consider if the problem can be reduced to how to combine and store results obtained in parallel
- If your problem is embarrassingly parallel, design your application to scale horizontally whenever possible
- Cloud computing introduces challenges such as:
- Provisioning resources
- Communication between machine instances
- Aggregating and storing results
- Modeling code for concurrent execution
- Web scale enables properties like:
- Rolling upgrades
- Elastic, horizontally scalable architecture
- Geographic distribution
- These properties introduce new levels of complexity regarding comprehension and fault tolerance
sync
package: handles Go's memory access synchronization