2 ms·
The problem with doing it all native is that stack sizes are quite variable, especially in managed languages where modularity and code reuse works better, so it
by native_samples 5y ago
The problem with doing it all native is that stack sizes are quite variable, especially in managed languages where modularity and code reuse works better, so it's common to have tons of libraries in a single project. The kernel won't object to lots of threads, but once those threads have been running for a while a lot of stack space will be paged in and used.
Loom solves this by moving stacks to and from the heap, where there's a compacting concurrent GC to clean up the unused space.