Skip to main content

Python: Greenlets

Someone pointed me at Greenlets the other day, and I'm really quite excited about them. This fully addresses the Limitations of Coroutines via Enhanced Generators I spoke of earlier. I see that "some very smart people" have gone down the path of tying it together with kqueue and select.poll along with an IO-based scheduler.

Greenlets look polished enough, but I sure wish the other stuff was polished and documented so that I could use it in production. The pragmatist in me (which doesn't come out very often) is still insisting that Twisted is still the safer route in the near term even if it is more irritating to code because of its asynchronous nature.


Bob Ippolito said…
There's some code here which you might find interesting:

I wrote it as a toy project. I have no current interest in it, but the code is there and works according to the friend of mine who is using it in production and hasn't had to fix any bugs since June... I decided to use Erlang instead of building and maintaining something from the ground up in Python.
Anonymous said…
You know what Ippolito? You freak me out with your smartness.
Matt said…

If you don't mind me asking, what's the scope of your Erlang project and how far along is it?

I ask because I had been thinking about using Erlang as a concurrency framework to execute C and C++ functions.

Kamaelia, along with ctypes, makes Python attractive. Only downside is that the GIL prevents benefitting from multiple processors on a single machine. But that could always be worked around by wrapping the C/C++ code in a separate OS process.

There are a lot of options...