Go Goroutines Concurrency

The cluster discusses Go's concurrency model, focusing on goroutines as green threads managed by the runtime, their efficiency compared to OS threads, misconceptions about single-threading, and comparisons to Node.js or other languages.

📉 Falling 0.4x Programming Languages
3,139
Comments
18
Years Active
5
Top Authors
#9661
Topic ID

Activity Over Time

2009
21
2010
13
2011
35
2012
148
2013
280
2014
172
2015
225
2016
213
2017
265
2018
208
2019
213
2020
196
2021
195
2022
223
2023
264
2024
270
2025
192
2026
6

Keywords

CPU JS AWS GOMAXPROCS node.js wg.Done libmill.org i.e E.g wg.Add goroutines threads concurrency concurrent thread coroutines async runtime execution node

Sample Comments

sagichmal Mar 27, 2016 View on HN

Go is not a single threaded language.

cdelsolar May 6, 2019 View on HN

Where's the evidence that Go can't handle large amounts of concurrency?

laurent123456 Jan 3, 2013 View on HN

He wrote that "In Go, writing concurrent code is more natural and efficiency of goroutines is much better than threads." I would have assumed goroutines were threads too. If not, how are they implemented?

ztoben Feb 21, 2018 View on HN

I believe you're thinking of concurrency, which go handles pretty well with goroutines.

jijji Feb 26, 2024 View on HN

how does this compare to using Go goroutines?

leshow Dec 20, 2017 View on HN

Isn't go's greenthread offering part of it's runtime? If you use a go channel or thread, is that not calling some go std lib abstraction? What you're talking about seems like a pretty non-idiomatic use of go.

jff Jan 2, 2013 View on HN

Goroutines are "green threads", small threads managed by the Go runtime and scheduled within multiple OS processes. I've never seen any indication that they're inefficient; I regularly create and destroy thousands of goroutines in less than a second. Oh, and Go doesn't have a global interpreter lock, so I'd expect the threading to work better than in python.

realrocker Sep 14, 2012 View on HN

In Go, the coroutines are in the same thread. There is a single thread here too(just like node.js). Coroutines are just multiplexed to the one main thread. Multi-Core Processing is handled by coroutine internals too i.e. there may or may not be more than one threads and even if there are more than one threads, they too will be multiplexed with the one main thread.

scoith May 30, 2012 View on HN

How about switching to Go and using goroutines?

enneff Apr 22, 2013 View on HN

Goroutines are not primarily about performance, they are for modelling concurrent processes in a natural way. This can have a performance in some cases, but I wouldn't classify goroutines the way you have.