3 ms·
Admittedly I'm not familiar with Erlang's preemptive model, but I'll ask anyway :) When using async based APIs with something like Akka, passing around futures
by switchbak 9y ago
Admittedly I'm not familiar with Erlang's preemptive model, but I'll ask anyway :)
When using async based APIs with something like Akka, passing around futures and such, and leveraging multiple actors in thread pools, doesn't that get you to approximately the same place as Erlang?
Sure, the JVM isn't doing the preempting, but the OS is. Is the main downside per-thread resource consumption and context scheduling overhead?
- anko 9y agoI think there is a lot to be said for the simplicity of the erlang model. It's not just about stopping a thread from hogging the cpu. The OS doesn't have a good idea when to wake threads up, so they are effectively polling needlessly. I do scala/akka in my dayjob and the amount of time we spend tweaking threadpools (execution contexts) and retesting just to get okay performance is insane. You wear a pretty big cost when you layer on abstractions like that.
- polskibus 9y agoAs far as I understand, Erlang scheduling is more aware of actor model resource usage patterns and NIFs than a combination of a JVM (or another runtime) + OS. It makes it more reliable and performant in the end (in places where scheduling matters).