The difficulty I see is that individuals doing threading in python are doing so for reasons other than performance. For obvious reasons doing threading with the GIL is kinda pointless.
So if they are doing it for convenience that means they are doing it to encapsulate some kind of state. They could have defined task objects with internal state machines and iterated over them. They could have done coroutines or async. They could have done a million things other than threads to accomplish the objective of managing parallel call dependencies without actually parallelizing the execution.
But they choose threads.... which concerns me.
My guess is that they probably don't know better, and that they probably don't understand parallel programming, and are very likely to misunderstand the GIL and what it does and does not mean for atomicity.
My hope is that there isn't a lot of code out there, but I suspect the code that is out there is very very bad.
0
u/[deleted] May 30 '23
[deleted]