Re:Free-threaded CPython is ready to experiment with
by hot_gril on Saturday July 13, 2024 @12:58PM
(#40955210)
These are "embarassingly parallel" examples that multiprocessing is ok for, though. There was always the small caveat that you can't pickle a file handle, but it wasn't a real problem. Threads are more useful if you have lots of shared state and mutexes.
I think these examples would also perform well with GIL'd threads, since the actual Python part is just waiting on blocking calls that do the expensive work. But maybe not.
Re:Free-threaded CPython is ready to experiment with
by kstrauser on Saturday July 13, 2024 @03:11PM
(#40956148)
> Threads are more useful if you have lots of shared state and mutexes.
That's what always kicks me in such things. If the processes are truly completely separable, awesome! It never seems like they are as much as I wish they were.
I've never let that stop me from getting the job done. There's always a way, and if we can't use tool A, then we'll make tool B work. It'll still be nice if it pans out that decent threading is at least an option.