[PATCH] D38570: Support: Rewrite Windows implementation of sys::fs::rename to be more POSIXy.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 10:50:32 PDT 2017


pcc added a comment.

In https://reviews.llvm.org/D38570#889483, @amccarth wrote:

> Would it be reasonble to have the callers cope with the possibility of an access violation and either retry or treat it as a failure?


Retry means that there will still be a race, it will just happen less often.

I'm not sure what you mean by "treat it as a failure". If you mean "treat it as if the file does not exist i.e. a cache miss" -- that might work, but I think it could disguise real access problems with the cache directory, and because a cache miss would lead to a ReplaceFile I think there could still be races between multiple callers of ReplaceFile due to the interval of no sharing.


https://reviews.llvm.org/D38570





More information about the llvm-commits mailing list