Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiprocessing #19

Open
acertain opened this issue Mar 30, 2013 · 6 comments
Open

Support multiprocessing #19

acertain opened this issue Mar 30, 2013 · 6 comments

Comments

@acertain
Copy link

multiprocessing is like threading but a bit slower and allows multiple processors fully.

@abingham
Copy link

Has anyone tried this? After a quick glance through the pykka source, and based on what I know about multiprocessing, it doesn't seem like this should be too difficult. But perhaps there are some issues that aren't immediately apparent.

@jodal
Copy link
Owner

jodal commented Aug 15, 2014

If you leave out any considerations about having actors running on different executors talking to each other, e.g. a system with only multiprocessing actors, you basically just need:

  • something that can run an actor (threads, eventlets),
  • something that can be the actor inbox which is safe to use concurrently under the given concurrency model (queue.Queue for threads), and
  • something that can return a single value or exception (often the same type as the actor inbox).

@abingham
Copy link

In a "classic" actor model the actors should only be communicating through message passing, so it sounds like multiprocessing should be easy to implement in principle.

Do you think there are many people sharing state across actors without message passing?

@jodal
Copy link
Owner

jodal commented Aug 15, 2014

I don't know of that many projects using Pykka, but at least in Mopidy we usually keep quite strictly to the actor rules.

That said, I think that you'll have problems using pykka.ActorRegistry in a multiprocessing context, since it is simply based on module-level global state, protected by locks.

@efibutov
Copy link

http://thespianpy.com/doc/

@cerlestes
Copy link

I'd love to see a backend implementation for both multiprocessing and asyncio. The multiprocessing backend should support Process and WorkerPool actors. Sadly I'm too new to Python to give it a serious try, but maybe I will once I've learnt more about the language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants