Antti Haapala <an...@haapala.name> added the comment:

I've been giving thought to implementing the locking on the instance or per 
instance instead, and there are bad and worse ideas like inserting per 
(instance, descriptor) into the instance `__dict__`, guarded by the 
per-descriptor lock; using a per-descriptor `WeakKeyDictionary` to map the 
instance to locks (which would of course not work - is there any way to map 
unhashable instances weakly?)

So far best ideas that I have heard from others or discovered myself are along 
the lines of "remove locking altogether" (breaks compatibility); "add 
`thread_unsafe` keyword argument" with documentation saying that this is what 
you want to use if you're actually running threads; "implement Java-style 
object monitors and synchronized methods in CPython and use those instead"; or 
"create yet another method".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43468>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to