Skip to Content
Get Programming with Go
book

Get Programming with Go

by Nathan Youngman, Roger Peppe
September 2018
Beginner
360 pages
9h 28m
English
Manning Publications
Content preview from Get Programming with Go

Lesson 31. Concurrent state

After reading lesson 31, you’ll be able to

  • Keep state safe
  • Use mutexes and reply channels
  • Employ service loops

Here we are back in the gopher factory. The busy gophers are still building things, but several of the production lines are running low on stock, so they need to order more.

Unfortunately, this is an old-fashioned factory that only has a single shared phone landline to the outside world. All the production lines have their own handset, though. A gopher picks up the phone to place an order, but as she starts speaking, another gopher picks up another handset and starts dialing, interfering with the first gopher. Then another does the same thing and they all get very confused and none of them manage to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Go Web Programming

Go Web Programming

Sau Sheong Chang
Java Coding Problems

Java Coding Problems

Anghel Leonard

Publisher Resources

ISBN: 9781617293092Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link