3 ms·
Goroutines are threads though (in the sense of preemtively scheduled concurrent execution sharing memory), they just aren't OS threads.
by masklinn 15y ago
Goroutines are threads though (in the sense of preemtively scheduled concurrent execution sharing memory), they just aren't OS threads.
- luriel 15y agoWhen Go was first presented Rob said the term "Goroutine" was introduced precisely to avoid this kind of confusions, but old habits are hard to kill and seems that even Rob himself still falls into this trap from time to time :)
- ralph 15y agoNo, he didn't. It's not a typo. :-)
- gtani 15y agoSimilar/analogous (I believe these all have significant differences)to F# MailboxProcessor, akka actors, erlang/BEAM processes and userspace/green threads in e.g. GHC,
- ww520 15y agoBut the title of the slide said, "Goroutines are not threads." I understand what you meant, but it's kind of confusing to use the same term for different things within the same slide while claiming they are different.
- skelterjohn 15y agoBut they aren't "preemptively scheduled concurrent execution sharing memory". They are "cooperatively scheduled concurrent execution sharing memory".
- 4ad 15y agoThe current implementations are cooperatively scheduled, but nothing in the specification prevents a preemptively scheduled implementation. After all, gccgo had a preemptively scheduled implementation until a few months ago. That being said, I prefer my goroutines to be cooperatively scheduled.