[pypy-dev] GIL hacks in pypy
arigo at tunes.org
Fri Jan 13 18:35:21 CET 2012
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.
More information about the pypy-dev