Message388592
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". |
|
Date |
User |
Action |
Args |
2021-03-13 04:58:17 | ztane | set | recipients:
+ ztane, rhettinger |
2021-03-13 04:58:17 | ztane | set | messageid: <1615611497.75.0.331695093175.issue43468@roundup.psfhosted.org> |
2021-03-13 04:58:17 | ztane | link | issue43468 messages |
2021-03-13 04:58:17 | ztane | create | |
|