Dynamically sizing the kernel stack
Dynamically sizing the kernel stack
Posted May 31, 2024 10:54 UTC (Fri) by kleptog (subscriber, #1183)In reply to: Dynamically sizing the kernel stack by Cyberax
Parent article: Dynamically sizing the kernel stack
For example, using Erlang where it is common to have one or more processes per client (eg WhatsApp). These processes are a form of user-space threading though and *very* lightweight. Largely because of the functional nature of the language, no sharing of data between processes and all data being read-only means the stacks can be very small (no registers to be saved/restored) and are allocated on demand. Millions of threads are not unheard of.
But it's running on an interpreter, so can't really be compared with OS level threads in Linux where you're limited by what the hardware can support. If the CPU supported dynamically allocating stack frames when calling a function you'd also be able to get away with much smaller stacks.