[pypy-dev] GIL

Yury V. Zaytsev yury at shurup.com
Sun Feb 26 05:12:50 EST 2017


On Sun, 26 Feb 2017, Sebastian K via pypy-dev wrote:

> can someone explain me why pypy needs the gil? In CPython the main 
> reason is the reference counting but pypy doesnt use reference counting.

The main reason is not the reference counting itself, but rather that the 
garbage collector (which happens to use reference counting) is not 
thread-safe. It is true that PyPy's garbage collectors do not use 
reference counting, but in itself, this doesn't make them any 
thread-safer. On top of that, there are more subtle issues to take care 
of, so instead of working towards removing the GIL, the decision was made 
to investigate a completely different approach to parallelization (STM):

http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why

-- 
Sincerely yours,
Yury V. Zaytsev


More information about the pypy-dev mailing list