Closed wang384670111 closed 5 months ago
Thanks for your contribution! I agree that
Relaxed
ordering is still correct here since we don't synchronize access to other data based on the counter.As separate feedback, do you mind making modifying the commit message? Something more specific like this would be great:
Use relaxed ordering for atomic block change counter
I've made the necessary changes to the commit information. May I inquire about the possibility of merging this pull request at your earliest convenience?
https://github.com/awslabs/coldsnap/blob/a60762c53f5ba3e8a0b6fa3d972ec082739f33df/src/upload.rs#L221 https://github.com/awslabs/coldsnap/blob/a60762c53f5ba3e8a0b6fa3d972ec082739f33df/src/upload.rs#L400 Here
changed_blocks_count
is employed solely for counting purposes, rather than for synchronizing access to other shared variables. WhileSeqCst
guarantees program correctness, it can also impact performance. Therefore, usingRelaxed
is sufficient to maintain the program's correctness without adversely affecting its efficiency.