3 ms·
On Linux/x86-32, the default stack size for a new thread is 2 mb. The default stack for a goroutine is 2 kb. Those 1000 goroutines eat up as much memory as ro
by presscast 8y ago
On Linux/x86-32, the default stack size for a new thread is 2 mb. The default stack for a goroutine is 2 kb.
Those 1000 goroutines eat up as much memory as roughy one OS thread.
Granted, I've somewhat shifted the goalpost, but goroutines are cheaper than OS threads or just about every sensible definition of "cheap".
- masklinn 8y ago> On Linux/x86-32, the default stack size for a new thread is 2 mb. It's just reserved, not committed until actually used. > Granted, I've somewhat shifted the goalpost Shifted? You've strapped them to a rocket and put them in orbit.