3 ms·
> You will rewrite your code to not make use of the guarantees. I suppose a problem is that unlike Java, Python is not fast enough to implement low level data
by comex 14y ago
> You will rewrite your code to not make use of the guarantees.
I suppose a problem is that unlike Java, Python is not fast enough to implement low level data structures in the language itself, so you can't easily implement non-thread-safe data structures without losing memory safety at the C level, which is unacceptable.
Still, I have the feeling that with heavy use of biased locking, you could stick locks everywhere without a lot of overhead in the non-contended case. Or maybe that famous patch just needs to be revisited, tweaked to more efficiently address the areas of highest contention... see http://dabeaz.blogspot.com/2011/08/inside-look-at-gil-removal-patch-of.html http://dabeaz.blogspot.com/2011/08/inside-look-at-gil-remova... for some context.
(some forms of biased locking are patented.)