This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ztane
Recipients rhettinger, ztane
Date 2021-03-13.04:58:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615611497.75.0.331695093175.issue43468@roundup.psfhosted.org>
In-reply-to
Content
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".
History
Date User Action Args
2021-03-13 04:58:17ztanesetrecipients: + ztane, rhettinger
2021-03-13 04:58:17ztanesetmessageid: <1615611497.75.0.331695093175.issue43468@roundup.psfhosted.org>
2021-03-13 04:58:17ztanelinkissue43468 messages
2021-03-13 04:58:17ztanecreate