Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 1. Goroutines are not threads

They are not kernel-level threads, but they are threads in every other meaningful sense; they have their own stack and execution pointer, and data operations in goroutines are not guaranteed to be atomic with respect to other goroutines.

While the current official Go implementation never preemptively schedules goroutines except on I/O and on runtime.Gosched(), nothing in the spec precludes a different, more kernel-thread-like scheduling system.



Using the term thread interchangeably with goroutine causes confusion, otherwise why bother having a different name for them in the first place?


Because there already exists a perfectly fine name for them: green threads (as opposed to operating system threads), using M:N threading.

http://en.wikipedia.org/wiki/Green_threads http://en.wikipedia.org/wiki/Thread_(computing)#M:N_.28Hybri...

They are just a subclass of threads.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: