Serhiy Storchaka added the comment:

Antoine reminded me about a lock. In Python implementation it needed because 
linked list modifications are not atomic. In C implementation linked list 
modifications are atomic. However dict operations can call Python code and 
therefore they are not atomic. I don't know what bad things can happened with 
concurrent cache updating, however using lock will be safer and cheap enought.

Please add lock field to lru_cache_object and use it as in Python 
implementation. If no one can prove that a lock is not needed.

----------
stage: commit review -> patch review

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

Reply via email to