Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
PEP 703 – Making the Global Interpreter Lock Optional in CPython (python.org)
42 points by hecanjog on Jan 10, 2023 | hide | past | favorite | 5 comments


This is VERY exciting: A PEP attacking one of the biggest problems with the CPython implementation: The Global Interpreter Lock. Will Python finally be rid of it after a decade of failed tries?


How do you manage concurrency problems in Python code?

I know they have answers for objects like 𝚕𝚒𝚜𝚝 and 𝚍𝚒𝚌𝚝, but What is the equivalent of the Java 𝚜𝚢𝚗𝚌𝚑𝚛𝚘𝚗𝚒𝚣𝚎𝚍 keyword? Are you supposed to use primitives like 𝙻𝚘𝚌𝚔 from

https://docs.python.org/3/library/threading.html

It seems to me one could make a @𝚜𝚢𝚗𝚌𝚑𝚛𝚘𝚗𝚒𝚣𝚎𝚍 annotation that would do nothing in a GIL Python but use a lock in a GIL-free Python.


>What is the equivalent of the Java 𝚜𝚢𝚗𝚌𝚑𝚛𝚘𝚗𝚒𝚣𝚎𝚍 keyword?

The closest equivalent would be using a lock, semaphore or barrier object with a context manager .i.e. the with keyword.

Making the locking and unlocking of data automatically managed for you.

I generally try to stick to a deque in Python if I am doing anything concurrent.


Maybe it's time for Python4 so this can become the default!

ducks


the year is 2036 and Python 3.25 is being released




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: