3 ms·
The space overhead is significantly worse for native threading in the presence of many threads since each thread needs both a user and kernel stack. For M:N, t
by DblPlusUngood 10y ago
The space overhead is significantly worse for native threading in the presence of many threads since each thread needs both a user and kernel stack.
For M:N, there are N kernel stacks.
- pcwalton 10y agoFair enough, but kernel stacks are 8K. 10K user + kernel size is a far cry from the 2MB default pthread stack size people usually talk about when they talk about 1:1. I don't know of any benchmark comparing Go vs. a 1:1 implementation with 2K pthread stack sizes, but I would be surprised if the performance difference is large at all.
- JoshTriplett 10y ago> Fair enough, but kernel stacks are 8K. And getting even cheaper than that, with the effort to make kernel stacks use virtual memory. As I understand it, once kernel stacks use virtual memory, they'll start out at a single 4k page.