goodboy / tractor

A distributed, structured concurrent runtime for Python (and friends)
GNU Affero General Public License v3.0
258 stars 12 forks source link

Who are the competitors? #85

Open goodboy opened 4 years ago

goodboy commented 4 years ago

There are a few "fronts" where this project is seeking to discover new low level solutions to problems in distributed computing. The main distinction is adherence to structured concurrency at the task and process level such that cancel-able CPU bound work is the new norm; of course we're also strongly tied to the development of trio and its paradigms.

There are quite a few modern projects in this space and their is likely lots to learn from each.

I've broken down some categories I've thought out but of course more are welcome.

actor model (in other languages or Python frameworks)

distributed computing (CSP, RPC, MAS) :

python specific

other langs, prots, rpcs

worker pool / parallel job processing

cancel-able cpu bound work

data streaming / pipelining

self replicating, take over the world, skynet type stuff:

alternative concurrency models

phaustin commented 4 years ago

Also worth mentioning:

https://joblib.readthedocs.io/en/latest/

which uses:

https://loky.readthedocs.io/en/stable/

goodboy commented 4 years ago

@phaustin slick, thanks for the links. Added them in.

goodboy commented 4 years ago

Some more actor model options from different language suggested by @salotz:

salotz commented 4 years ago

quasar isn't defunct, its just that the main author went off to work on project Loom for the JVM so that quasar actually has a purpose (unlike python "threads"). Syndicate is interesting because of some of the design patterns over actors that it provides for distributed systems along the lines of tuple spaces. Let me add a few more things with interesting links to actor modelly things:

salotz commented 4 years ago

As usual I have no code but more projects to compare to :P

https://dotnet.github.io/orleans/Documentation/index.html

Also the Akka documentation seems thorough and is in general I think a success story (albeit super heavyweight):

https://doc.akka.io/docs/akka/current/general/actor-systems.html

goodboy commented 4 years ago

@salotz hehe fine by me.

I actually mention aka and orleans in #18 funny enough. I guess linking the discussions is of use to some degree.

goodboy commented 4 years ago

I started digging through the core of locust and was interested in how they do their multi-processing stuff to find out that they kinda, don't do anything, heh, despite having a pretty cool design what with gevent and zeromq :smile: for their "worker pool" thing.

I just so happened to discover (whilst looking for non-existing process spawning code) that gevent has a coolio processing spawning system gevent.os.fork() which seems to do some supervisory management stuff. At the very least I'd like to dig through the code in preparation for #117.

goodboy commented 3 years ago

This is a cool blog post by the ray peeps that goes through comparisons with multiprocessing. Obviously they're cheating to some degree since the core of ray is C++.

I think doing the same but with the SharedArray from piker and tractor would be a great exercise for both bench-marking and API scrutiny.

jkleckner commented 2 years ago

An interesting alternative in the Scala language is zio [1].

It uses Structured Concurrency and makes this statement [2]:

ZIO has support for structured concurrency. The way ZIO structured concurrency works is that the child fibers are scoped to their parent fibers which means when the parent effect is done running then its child's effects will be automatically interrupted. So when we fork, and we get back a fiber, the fiber's lifetime is bound to the parent fiber, that forked it. It is very difficult to leak fibers because child fibers are guaranteed to complete before their parents.

The structure concurrency gives us a way to reason about fiber lifespans. We can statically reason about the lifetimes of children fibers just by looking at our code. We don't need to insert complicated logic to keep track of all the child fibers and manually shut them down.

See also: https://github.com/goodboy/tractor/issues/18 https://github.com/goodboy/tractor/issues/118

[1] https://github.com/zio/zio [2] https://github.com/zio/zio/blob/master/docs/datatypes/fiber/index.md#structured-concurrency