|
|
|
|
|
by crawshaw
3154 days ago
|
|
The goroutine implementation scales, while other thread implementations (by default) do not. That's a semantic difference. A Go server can have millions of active goroutines with moderate resource use. You can achieve the same on Linux or Solaris using kernel threads, but you have to work at it. With Go you don't have to work at it, and it works on macOS and Windows and a few other OSs too. This is all comparisons between O(1) things, but the constant factor matters. |
|
By setting the thread stack size to a reasonable value. That's it. And, in fact, on 64-bit you often don't even need to do that.
The difference you're describing is a difference in default thread stack sizes, which is hardly a paradigm shift. We're talking about one call to pthread_attr_setstacksize().