Skip to Content
Go: Building Web Applications
book

Go: Building Web Applications

by Nathan Kozyra, Mat Ryer
August 2016
Beginner to intermediate
665 pages
14h 11m
English
Packt Publishing
Content preview from Go: Building Web Applications

Understanding goroutines versus coroutines

At this point, you may be thinking, "Ah, goroutines, I know these as coroutines." Well, yes and no.

A coroutine is a cooperative task control mechanism, but in its most simplistic sense, a coroutine is not concurrent. While coroutines and goroutines are utilized in similar ways, Go's focus on concurrency provides a lot more than just state control and yields. In the examples we've seen so far, we have what we can call dumb goroutines. Although they operate in the same time and address space, there's no real communication between the two. If you look at coroutines in other languages, you may find that they are often not necessarily concurrent or asynchronous, but rather they are step-based. They yield 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

Hands-On Full Stack Development with Go

Hands-On Full Stack Development with Go

Mina Andrawos

Publisher Resources

ISBN: 9781787123496