With all the excitement surrounding Tornado Web Server, I'd like to mention that I wrote a great article last year on Python Concurrency, with an emphasis on the various approaches to writing Web servers.
By the way, has anyone played with gevent or Eventlet? Like the proprietary version of stackless Python we used at IronPort, they offer asynchronous networking without the need to use continuation passing style.
Happy Hacking!
By the way, has anyone played with gevent or Eventlet? Like the proprietary version of stackless Python we used at IronPort, they offer asynchronous networking without the need to use continuation passing style.
Happy Hacking!
Comments
I have an eventlet app running in production and I'm in progress of writing next. It's definitely worth giving a shot! You may be interested in eventlet's twisted hub, although I didn't try it myself.
Over Twisted Python world, the general idea is to have as much processes as You have CPUs and then somehow load balance across.
The GIL is a subtle thing. As long as the threads don't require use of the GIL, you're fine. For instance, they can each be blocked on IO or doing something a C library that releases the GIL.
I agree with using processes over threads in a lot of situations. However, I like Erlang's approach even more, and I've always been a fan of the tricks used by gEvent.
Thanks for reading!