by p_m_c · 8mo ago · 0 comments
Perhaps I'm stating the obvious, but you deal with this with lock-free data structures, immutable data, siloing data per thread, fine-grain locks, etc.
Basically you avoid locks as much as possible.
Imo the GIL was used as an excuse for a long time to avoid building those out.
Hence why basic Python structures under free-threaded Python are all thread-safe structures, and explains why they are slower than GIL-variant.