3 ms·
You can customize it but the default value for Linux is 2MB, the Go one is 2KB, pretty big difference in term of memory. http://man7.org/linux/man-pages/man3/p
by Thaxll 8y ago
You can customize it but the default value for Linux is 2MB, the Go one is 2KB, pretty big difference in term of memory.
http://man7.org/linux/man-pages/man3/pthread_create.3.html http://man7.org/linux/man-pages/man3/pthread_create.3.html
- pcwalton 8y agoIt's just a question of defaults. If stack size is your only concern, then change the default in your runtime: don't go M:N.
- romed 8y agoLinux does not immediately map 2MB of stack for every thread. That would be ridiculous. Look in proc/smaps to see how much space your stacks actually occupy.
- mikepurvis 8y ago2KB is tiny, that must be a default which grows or is extended as required? Obviously it works out okay for them, but I feel like it would add nontrivial overhead to every function call if you're always having to check whether or not you need to grow your stack to accommodate the new frame.