Wouldn't "create", "getcurrent" and "switch" be better primitives for coroutines [0]?
Having a concept of caller and callee complicates the maintenance of a large number of "concurrent" coroutines that does different things, and "yield" can be implemented by just using a global variable.
Wouldn't "create", "getcurrent" and "switch" be better primitives for coroutines [0]?
Having a concept of caller and callee complicates the maintenance of a large number of "concurrent" coroutines that does different things, and "yield" can be implemented by just using a global variable.
[0]: http://pypy.readthedocs.org/en/latest/stackless.html#corouti...