| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
These are technically data races, but I think they're benign (to the extent that that is actually possible). We update cache entries non-atomically but read them atomically from another thread, and there's nothing that establishes a happens-before relationship between the reads and writes that I can see. Sample races reported by TSAN: - https://gist.github.com/mpage/8633aacbf11303bdfdbda2c0e644d43d - https://gist.github.com/mpage/70d5758968c0225384a2ace448122d09 - https://gist.github.com/mpage/33436b62af0d2e688f36c4ecb9171dee
There was a problem hiding this comment.
LGTM!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
These are technically data races, but I think they're benign (to the extent that that is actually possible). We update cache entries non-atomically:
cpython/Objects/typeobject.c
Lines 4974 to 4984 in a23fa33
but read them atomically from another thread:
cpython/Objects/typeobject.c
Lines 5046 to 5051 in a23fa33
and there's nothing that establishes a happens-before relationship between the reads and writes that I can see.
In practice I don't think this matters much. We care about always reading the entire entry atomically, and the sequence lock enforces that.
Sample races reported by TSAN: