3 ms·
Erlang will use multiple OS threads if you start it with '-smp enabled'. Otherwise it would be limited to a single core. Each thread runs a scheduler and the m
by jamii 11y ago
Erlang will use multiple OS threads if you start it with '-smp enabled'. Otherwise it would be limited to a single core.
Each thread runs a scheduler and the many Erlang processes are balanced between the schedulers. There is still only one OS process though.
http://erlang.2086793.n4.nabble.com/Some-facts-about-Erlang-and-SMP-td2108770.html http://erlang.2086793.n4.nabble.com/Some-facts-about-Erlang-...
- geofft 11y agoYeah, that's well-suited to Rust's design (although Rust didn't ship with libgreen, the requirements of libgreen influenced the type system, and you can do a similar thing with a third-party library). In any case the distinction between "multiple processes" and "multiple threads" here is fairly minimal, at least on Linux or OS X. As far as the kernel is concerned, they're the same object (Linux calls them threads; Mach calls them tasks). It's just that sometimes, groups of these things share pointers to things like memory map or file descriptor table, and sometimes they have their own pointers. There isn't a whole lot of difference, either at the language level or the kernel level, between running multiple processes from the same executable image that map a shared heap versus just running multiple threads.