[Stackless] Multi-CPU Actor Based Python
tbaldridge at gmail.com
Wed Nov 19 15:49:25 CET 2008
What I'm more looking to reduce, is the overhead of transferring data
from one Python VM to another. In current implementations transferring
data from one VM to another requires pickling data (and that requires
traversing the entire object being transmitted, pickling each part
along the way), transmitting it across the wire, then unplickling it
at the other end. So where talking thousands of cycles.
In the method I'm proposing, you could have multiple "VMs" in the same
process, with a unified GC, these VMs would would share nothing. If
all messages are immutable, then all that is required is to copy a
pointer from one VM to the other and increment the GC ref count on the
message. That's what, 100-200 cycles or so (yes I did just pull that
out of the air).
My core idea here is that multitasking in modern languages isn't as
pervasive because of the overhead/risks involved. In C you have shared
memory issues. In Erlang, well, many people can't stand the Erlang
syntax. And in Python you can't have to pass messages via
So does anyone else see this being possible, or am I off my rocker?
More information about the Stackless