Alex

Concurrency Gotchas (Video 30)

Race Conditions

Deadlock

Goroutine Leaks

func main() {
  ch := make(chan obj)

  go func() {
    // some long non blocking work...
    ch <- something
  }()

  select{
  case rslt := <-ch:
    fmt.Println(rslt)
  case <-time.After(timeout):
    fmt.Println("Timed out")
  }
}

Channel Errors

Other Misc Errors

Dining Philosophers

Incorrect Use of Waitgroup

A Bit More on Select

Useful Takeaways