4 ms·
Pony does not do preemptive scheduling. Pony actors have behaviors, which can be thought of as methods that handle messages that are sent to the actor; these ar
by aturley 9y ago
Pony does not do preemptive scheduling. Pony actors have behaviors, which can be thought of as methods that handle messages that are sent to the actor; these are the unit of scheduling, and a behavior runs from beginning to end without preemption. Multiple behaviors can run at the same time, but only one behavior per actor can be running at any time.
There is currently no equivalent to Distributed Erlang, but that's something that the creator of the language has been looking into.
- spooneybarger 9y agoA bit more info. Sebastian Blessing did a thesis on Distributed Pony. You can read it here: https://www.ponylang.org/media/papers/a_string_of_ponies.pdf https://www.ponylang.org/media/papers/a_string_of_ponies.pdf At this time, there is no "in the wild" implementation.
- macintux 9y agoThanks. As an Erlang fan, I'm curious how types and networking are going to overlap.
- polskibus 9y agoPreemptive scheduling is one of the advantages of Erlang over other actor implementations like Akka. Please consider implementing it!
- switchbak 9y agoAdmittedly 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).