|
Alternatives:
Other ideas:
|
|
Here's a scenario that I'm worried about but haven't proved that it can occur.
Possible solutions (if in fact there is a problem):
|
|
On general principle, I'd urge looking at ways that are "obviously correct" instead of "so clever I'm not sure whether I can concoct a failing case". Two possibly relevant things follow from that. Whenever other threads or reentrancy may occur:
Those are big steps on the way to "obviously correct". And obviously so, right? Don't fight sanity 😄. |
|
https://bugs.python.org/issue35780 is closed. What is the status of this PR? |
Hello Tim, if you have the time can you give your thoughts on this?
I've been through the code a few times and can't convince myself that the existing code won't fail in exotic cases (ones where the
__eq__call triggers arbitrary code). My thought is to mark links as unused when they are new or have been extracted from the doubly linked list, and then to use that information to skip invalid actions if another thread or reentrant call is also modifying the same link or the cache dictionary.In the last PR, GH-11623, I fixed-up the more obvious bugs and added extensive commentary that may help with the analysis.
https://bugs.python.org/issue35780