3 ms·
Goroutines are just threads with a particularly idiosyncratic implementation.
by pcwalton 9y ago
Goroutines are just threads with a particularly idiosyncratic implementation.
- mjevans 9y agoEdit (first line); actually maybe it's my definition of 'thread' that is different. I think of a process as a security context that has one or more CPU routines (complete set of state). Goroutines are not threads in that sense, they lack that CPU state and are just segments of code (logic and data-state). Goroutines are 'soft threads'. The underlying implementation typically defaults to number of CPU cores as max possible REAL thread count. The real threads will check the message queues for possible wakeups when the previous soft thread blocks or terminates.