Live data from Hacker News

Pykka - Actors For Python

pykka.readthedocs.org

11–17 of 17 posts

Re: Pykka - Actors For Python

#11

Won't the GIL really limit the performance of this?

sweet, I was wondering when someone was going to mention the GIL, now the fun can start. http://dabeaz.blogspot.com/2012/03/pycon-2012-followup.html "In any case, the performance of threads is highly specific to the application at hand. You can't just take some benchmark from one of my GIL talks and extrapolate that out to a general statement about all Python thread programming. Personally, I find that Python threads…

the multiprocessing module has "Managers" which can be used for IPC. I'm guessing that you could just communicate with those via Unix sockets, or TCP sockets on 127.0.0.1 and get pretty comparable results with 0mq, no?

I've been using managers over TCP for use as an image cache (the program is essentially an image resizing proxy), and in my limited benchmarks, it's fast enough. Now, this isn't some real-time trading application, so maybe 0mq would squeeze something, but TCP/Unix sockets is probably fast enough for most purposes here.

Re: Pykka - Actors For Python

#13

Won't the GIL really limit the performance of this?

Not on Jython, which has no GIL by virtue of the JVM. Work on Jython has recently resumed and the new work is focusing on adding InvokeDynamic support, which I think is really exciting.

(I say this all as a Rubyist who as seen these same problems on the Ruby side)

Re: Pykka - Actors For Python

#14
Hi there, I'm working on a similar actor library in Ruby:

http://celluloid.io/

The main thing I'd like to say is that there is a well-researched way to combine actors and object oriented programming. After stumbling upon this particular combination myself, I discovered it had been done a decade and a half earlier in Python:

http://python.org/workshops/1997-10/proceedings/atom/

I believe the original source code has since been lost, but I would strongly encourage you to read their paper.

Actor-based concurrent object oriented programming makes using actors as transparent as using objects.

Re: Pykka - Actors For Python

#15
post #11

Earlier quoted context omitted.

sweet, I was wondering when someone was going to mention the GIL, now the fun can start. http://dabeaz.blogspot.com/2012/03/pycon-2012-followup.html "In any case, the performance of threads is highly specific to the application at hand. You can't just take some benchmark from one of my GIL talks and extrapolate that out to a general statement about all Python thread programming. Personally, I find that Python threads…

the multiprocessing module has "Managers" which can be used for IPC. I'm guessing that you could just communicate with those via Unix sockets, or TCP sockets on 127.0.0.1 and get pretty comparable results with 0mq, no? I've been using managers over TCP for use as an image cache (the program is essentially an image resizing proxy), and in my limited benchmarks, it's fast enough. Now, this isn't some real-time trading…

well for me , 0mq makes ipc easy, I'm not too concerned about performance myself. though I do enjoy it. :)

Re: Pykka - Actors For Python

#16
post #13

Won't the GIL really limit the performance of this?

Not on Jython, which has no GIL by virtue of the JVM. Work on Jython has recently resumed and the new work is focusing on adding InvokeDynamic support, which I think is really exciting. (I say this all as a Rubyist who as seen these same problems on the Ruby side)

It's great to see that Jython development has picked up! For the interested, details are at

http://sourceforge.net/mailarchive/forum.php?thread_name=jja...

Re: Pykka - Actors For Python

#17

Actor model concurrency is way more fun and easy to use than handling threads on your own. It's really nice to see this coming to Python. Let's just hope that this project doesn't get neglected like the one for Ruby.

Apparently this was already done for python a few years ago:

I just discovered a very similar, albeit older project that essentially does the same (i.e. implementing the actor model on top of threads, greenlets or stacklets)

http://osl.cs.uiuc.edu/parley/

The most important part, i.e. the download section, seems to be down though.

Post reply on HN