3 ms·
You will always get either [1,2,3,4,5,6] or [4,5,6,1,2,3] in the upcoming `--disable-gil` builds of CPython 3.13 and the nogil forks. Most operations on mutable
by colesbury 3y ago
You will always get either [1,2,3,4,5,6] or [4,5,6,1,2,3] in the upcoming `--disable-gil` builds of CPython 3.13 and the nogil forks. Most operations on mutable collections hold a per-object lock.
Part of the integration work will be to better document the thread-safety guarantees, but there is still a lot of work to do before we get there.
- HDThoreaun 3y agoEvery mutable collection needs to lock before write? Sounds slow af
- quietbritishjim 3y agoLocks are generally very cheap if they're not contended. Of course it's all relative though!
- gnulinux 3y agoThey're cheap but they're not free. If you do it at literally every single rw operation at runtime, it's going to add up.
- fbdab103 3y agoLast I looked, the nogil implementation was some 5-10% slower than the current, owing to all of the extra locking.