3 ms·
I assume they mean Python doesn't do so by default (nor in a lightweight fashion). You can certainly use all cores with any programming runtime if you just run
by clessg 2y ago
I assume they mean Python doesn't do so by default (nor in a lightweight fashion). You can certainly use all cores with any programming runtime if you just run multiple OS processes. Indeed, that's how you implement multi-core on Ruby and Node as well. Although even then, the cores themselves aren't necessarily being fully utilized, even if you're ostensibly using all cores.
- hosh 2y agoBecause it is not by default, you don't really use all the cores by default either.
- OutOfHere 2y agoPython 3.13 beta1 can be compiled with no-GIL mode, which allows free-threading that could perhaps use all cores.
- hosh 2y agoLet’s say we do that. How many threads can we create? On BEAM, running 10,000 lightweight processes is normal. Phoenix is designed so that every incoming http request is its own lightweight process. How does one manage that number of lightweight processes? The runtime’s scheduler keeps track of every single process so nothing is orphaned. It is preemptive, so no lightweight process can starve out another (though there are some exceptions). They can also suspend cheaply, as such, works well with async io. The closest thing to this are the new virtual thread feature of recent Java. I don’t think Java has the same kind of properties that will allow it to manage it as well as BEAM. There is a lot more to Elixir than being able to use all the cores.
- OutOfHere 2y agoOh certainly; I never meant to think that Python competes with Elixir in this regard. It doesn't.