Re:Go 1.16 will make system calls through Libc on OpenBSD
by masklinn on Wednesday February 03, 2021 @11:09AM
(#26014975)
> 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.
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.