Awesome news. I'm kind of scared to think how much Python code is written to assume the GIL though. I have a feeling a lot of libraries and code will have very subtle race conditions and issues, but it's still great to have an option for getting around the GIL.
I think the big idea is that this STM only attempts to commit at points where the GIL would have traditionally been released anyway - after so many bytecodes or some other condition. The linearisation of the memory writes of the different threads should be the same as if there was a GIL.
PyPy already has custom python code for different bits, like the crypto library - because this code was written in c for cpython (and the c code gets around the GIL, funnily enough). So PyPy may be required to make more custom code for it all to work, though if it tries to emulate the GIL as specified below, probably not.
Comments
Awesome news. I'm kind of scared to think how much Python code is written to assume the GIL though. I have a feeling a lot of libraries and code will have very subtle race conditions and issues, but it's still great to have an option for getting around the GIL.
I think the big idea is that this STM only attempts to commit at points where the GIL would have traditionally been released anyway - after so many bytecodes or some other condition. The linearisation of the memory writes of the different threads should be the same as if there was a GIL.
PyPy already has custom python code for different bits, like the crypto library - because this code was written in c for cpython (and the c code gets around the GIL, funnily enough). So PyPy may be required to make more custom code for it all to work, though if it tries to emulate the GIL as specified below, probably not.