28 points · by arem · 17y ago · 14 comments
As it stands now, unless I had a big need for bazillions of contexts, I wouldn't touch stackless because I've already got to use other mechanisms to get work running on a lot of different cores / machines at once anyway. Since I'm already doing that, it's nicer to stick to the one mechanism and design things to work within it (keep contexts <1,000).
Still the big deal about co-routines for me is not mainly raw performance (or core-utilization) but rather the programming model. I've literally slashed the LOC-count in half for some of our projects just by moving to co-routines, that's what I call a productivity boost.
Also I find myself enjoying co-routines much more than the tangled mess of callbacks and data-locality issues in the multithreaded world.
It sounds like you already have a method you're comfortable with, so there's obviously not much reason to look for something else unless you are tearing your hair out with your current solution.
Stackless DOES NOTHING ABOUT THE GIL! Stackless is not about concurrency. It's about implementing coroutines.
It's a really easy mistake to make. Lots of people think Stackless threadlets look like Erlang processes, but instead, they look more like regular Python generators (although they're admittedly much cooler). To complicate matters, people sometimes actually do use the fact that you can pickle threadlets, send them across the wire, and resume them on another thread/process/machine to implement some form of concurrency, but this does not mean that Stackless gets around the GIL in any way vanilla CPython can't.
To explain more about Stackless, I'll refer you to Jesse Noller's recent post on the subject: http://jessenoller.com/2009/02/23/stackless-you-got-your-cor...