Open 1992leiting opened 1 year ago
I haven't looked into multiprocessing in a long time, but Pykka had support for gevent and eventlet as alternatives to threading until recently, so the flexibility to build multiprocessing support is there.
I should mention that with threading/gevent/eventlet there was no support for mixing and communicating across the different runtimes. I assume you don't want to run everything as its own process?
I have a idea of gevent/eventlet but I did have a google search on how it works. I do not worry about IO intensive tasks but compute intensive ones. It will be great if actors in different processes can communicate to workaround Python GIL limitation and improve performance.
I didn't intend for you to use gevent/eventlet, I just tried to point out that it should be fairly easy to make Pykka use processes instead of threads, just like it previously supported "green threads" instead of threads.
However, Pykka has never had support for mixing runtimes, e.g. having a group of actors running as threads in one process communicating with an actor in another process. That would probably require large changes to Pykka's APIs.
Thus, the realistic alternatives are to either:
Wouldn't disabling the GIL(https://github.com/python/cpython/pull/116338) (I know it is still experimental) solve the issue, that is the actors would be able to run on different cores without any code changes ?
Actor model is often used to build a MMO server. I just found Pykka easy to use. Is it possible to work with Python mutl-processing without much additional effort to take full advantage of multi-cores?