[pypy-dev] GIL hacks in pypy

Armin Rigo arigo at tunes.org
Fri Jan 13 18:35:21 CET 2012


Hi Timothy,

On Fri, Jan 13, 2012 at 16:37, Timothy Baldridge <tbaldridge at gmail.com> wrote:
> But in CPython we
> can do this ugly little hack for getting "free" locks where you
> basically set the GIL "remaining" bytecodes count to 32 billion,
> execute your code, then return it to the original value.

Bah!  That's a hack indeed.

I think the cleanest solution would be to write the compare-and-swap
operation as C code in CPython, and as RPython code in PyPy.

Otherwise, I'm unsure about getting compare-and-swap, but you can
definitely do some atomic operations using lists or dicts.


A bientôt,

Armin.


More information about the pypy-dev mailing list