[pypy-dev] thoughts on built-in support for coroutine suspension on lowlevel io

Armin Rigo arigo at tunes.org
Wed Sep 28 10:13:19 CEST 2011

Hi Ronny,

On Tue, Sep 27, 2011 at 23:27, Ronny Pfannschmidt
<Ronny.Pfannschmidt at gmx.de> wrote:
> I’d like to collect thoughts on having built-in primitives for
> co-routine suspension
> it would greatly simplify the work for tool-kits like eventlet/gevent,
> since no longer they would need to monkey-patch all parts of the std-lib

While it's a worthwhile goal, I don't know if the final benefit is
positive.  I can see two ways to do it inside PyPy: either we tweak
all built-in functions to call OS-provided non-blocking versions
internally (which wouldn't be any less annoying than just patching all
stdlib functions from app-level), or we spawn threads and run the
blocking calls there (but then you have a big scalability issue).
Ideally a mix of the two would be best, but I don't quite see how to
work around *all* scalability issues.

A bientôt,


More information about the pypy-dev mailing list