The first year of free-threaded Python
11–20 of 302 posts
Re: The first year of free-threaded Python
#12[flagged]
Re: The first year of free-threaded Python
#13[flagged]
Re: The first year of free-threaded Python
#14Earlier quoted context omitted.
how does the the language being dynamic negatively affect the complexity of multithreading?
Is there so much legacy python multithreaded code anyway? Considering everyone knew about the GIL, I'm thinking most people just wouldn't bother.
Re: The first year of free-threaded Python
#15Am I the only one who sort of fears the day when Python loses the GIL? I don't think Python developers know what they’re asking for. I don't really trust complex multithreaded code in any language. Python, with its dynamic nature, I trust least of all.
As a Python dabbler, what should I be reading to ensure my multi-threaded code in Python is in fact safe.
https://www.youtube.com/watch?v=_9B__0S21y8 is fairly concise and gives some recommendations for literature and techniques, obviously making an effort in promoting PlusCal/TLA+ along the way but showcases how even apparently simple algorithms can be problematic as well as how deep analysis has to go to get you a guarantee that the execution will be bug free.
Re: The first year of free-threaded Python
#16Re: The first year of free-threaded Python
#17[flagged]
Re: The first year of free-threaded Python
#18Earlier quoted context omitted.
Is there so much legacy python multithreaded code anyway? Considering everyone knew about the GIL, I'm thinking most people just wouldn't bother.
There is, and what's worse, it assumes a global lock will keep things synchronized.
Re: The first year of free-threaded Python
#19My understanding is that the GIL has lasted this long not because multi-threaded Python depends on it, but because removing it:
- Complicates the implementation of the interpreter
- Complicates C extensions, and
- Causes single-threaded code to run slower
Multi-threaded Python code already has to assume that it can be pre-empted on the boundary between any two bytecode instructions. Does free-threaded Python provide the same guarantees, or does it require multi-threaded Python to be written differently, e.g. to use additional locks?
Re: The first year of free-threaded Python
#20Earlier quoted context omitted.
As a Python dabbler, what should I be reading to ensure my multi-threaded code in Python is in fact safe.
The literature on distributed systems is huge. It depends a lot on your use case what you ought to do. If you're lucky you can avoid shared state, as in no race conditions in either end of your executions. https://www.youtube.com/watch?v=_9B__0S21y8 is fairly concise and gives some recommendations for literature and techniques, obviously making an effort in promoting PlusCal/TLA+ along the way but showcases how even…
Of course, while the transcription is in action the rest of the UI (Qt via Pyside) should remain usable. And multiple transcription requests should be supported - I'm thinking of a pool of transcription threads, but I'm uncertain how many to allocate. Half the quantity of CPUs? All the CPUs under 50% load?
Advise welcome!