Comment by westurner

Comment by westurner 3 days ago

4 replies

"PEP 703 – Making the Global Interpreter Lock Optional in CPython" (2023) https://peps.python.org/pep-0703/

CPython built with --disable-gil does not have a GIL (as long as PYTHONGIL=0 and all loaded C extensions are built for --disable-gil mode) https://peps.python.org/pep-0703/#py-mod-gil-slot

"Intent to approve PEP 703: making the GIL optional" (2023) https://news.ycombinator.com/item?id=36913328#36917709 https://news.ycombinator.com/item?id=36913328#36921625

kaashif 3 days ago

This is pretty beside the point. The point is that X not having a GIL doesn't inherently mean Python on X also doesn't have a GIL.

  • westurner 2 days ago

    CPython does not have a GIL Global Interpreter Lock GC Garbage Collection phase with --gil-disabled. GraalVM does have a GIL, like CPython without --gil-disabled.

    How CPython accomplished nogil in their - the original and reference - fork is described in the topical linked PEP 703.

    • kaashif 2 days ago

      Yes, I know. What I'm saying is that:

      It's possible to have a language that doesn't have a GIL, which you implement Python in, but that Python implementation then has a GIL.

      The point being that you can't say things like: Jython is written in Java so it doesn't have a GIL. CPython is written in C so doesn't have a GIL. And so on.

      If this isn't clear, I apologize.

      • westurner 2 days ago

        Oh okay. Yeah I would say that the Java GC and the ported CPython GIL are probably limits to the performance of any Python in Java implementation.

        But are there even nogil builds of CPython C extensions on PyPi yet anyway.

        Re: Ghidraal and various methods of Python in Java: https://news.ycombinator.com/item?id=36454485