Skip to content

symonk/go-concurrency-deep-dive

Repository files navigation

Go Concurrency

This repository houses various golang concurrency pattern implementations. If you are new to concurrency in go, the optimal order to review the solutions is outlined below:


Patterns


Pattern Overviews

  • Goroutines - A basic implementation of goroutines, running things asynchronously.
  • Channels - A communication mechanism between goroutines, sharing memory by communicating.
  • Generators - Python like generators, a function returns a channel to interact with it.
  • Fan In - Merging multiple goroutines results into a single channel for processing.
  • Restore Sequence - Fan in with a twist, allowing order of fanned channel results to be controlled.
  • Select Timeout - Giving a routine a period of time to finish else doing something else.
  • Quit Signal - Signally to a goroutine that it is time to stop potentially early.
  • Daisy Chain - Many goroutines, passing along messages like chinese whispers - confusing!
  • Google Search Synchronous - A synchronous implementation of basic google searching.
  • Google Search Asynchronous - Goroutines per search type and filtering in results.
  • Google Search Asynchronous Filtered - Omitting results that took too long.
  • ...
  • Worker Pool - Fan out work to multiple works to complete in parallel.

Learning Materials TODO

More materials to include in the repository, things I personally need to learn more about:

  • indepth channels
  • go scheduler, runtime and os thread specifics
  • daisy chain is confusing!

About

A deep dive into go concurrency patterns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages