On Wed, Sep 6, 2017 at 3:49 AM, INADA Naoki <songofaca...@gmail.com> wrote:

> OK, I stop worring about thread safety and other implementation
> detail behavior on edge cases.
>

That sounds like overreacting. At the risk of stating the obvious:

I want the data structure itself to maintain its integrity even under edge
cases of multi-threading. However that's different from promising that all
(or certain) operations will be atomic in all cases. (Plus, for dicts and
sets and other data structures that compare items, you can't have atomicity
if those comparisons call back into Python -- so it's extra important that
even when that happens the data structure's *integrity* is still
maintained.)

IMO, in edge cases, it's okay to not do an operation, do it twice, get the
wrong answer, or raise an exception, as long as the data structure's
internal constraints are still satisfied (e.g. no dangling pointers, no
inconsistent indexes, that sort of stuff.)

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to