3 ms·
> Goroutines don't map directly to OS threads though, do they? So in practice it only matters for "hard" threads. It matters for goroutines because that means
by masklinn 6y ago
> Goroutines don't map directly to OS threads though, do they? So in practice it only matters for "hard" threads.
It matters for goroutines because that means you can't straight call into foreign code from a goroutine's stack, which is why cgo and friends are so problematic.
> Also the default pthread stack size is (usually) 2MB which is indeed non negligible if you have a ton of threads
That's not relevant because it's not vmem is the point. The actual resident size of a 2MB stack is 4k unless you start dirtying more pages. Unless you're running on 32b, VMEM doesn't really matter.