
Hello everbody, can someone explain me why pypy needs the gil? In CPython the main reason is the reference counting but pypy doesnt use reference counting. Thanks in advance. Regards Sebastian

Please check PyPy-STM http://doc.pypy.org/en/latest/stm.html On Sun, Feb 26, 2017 at 3:43 PM Sebastian K via pypy-dev < pypy-dev@python.org> wrote:

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

Hi, On 26 February 2017 at 11:12, Yury V. Zaytsev <yury@shurup.com> wrote:
To complete that answer, I updated the faq: http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why A bientôt, Armin.

Please check PyPy-STM http://doc.pypy.org/en/latest/stm.html On Sun, Feb 26, 2017 at 3:43 PM Sebastian K via pypy-dev < pypy-dev@python.org> wrote:

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

Hi, On 26 February 2017 at 11:12, Yury V. Zaytsev <yury@shurup.com> wrote:
To complete that answer, I updated the faq: http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why A bientôt, Armin.
participants (4)
-
Armin Rigo
-
Phyo Arkar
-
Sebastian K
-
Yury V. Zaytsev