Add racerelaxed::OnceNonZeroUsizeRelaxed.#282
Add racerelaxed::OnceNonZeroUsizeRelaxed.#282briansmith wants to merge 1 commit intomatklad:masterfrom
racerelaxed::OnceNonZeroUsizeRelaxed.#282Conversation
Add a variant of `OnceNonZeroUsize` that uses relaxed ordering, for reduced overhead, especially on ARM/AArch64 and other weakly-ordered systems. This is pretty much straight copy-pasta from `race` to `racerelaxed`: ``` git difftool HEAD:src/race.rs src/racerelaxed.rs git difftool HEAD:tests/it/race.rs tests/it/racerelaxed.rs ```
|
Hm, I am a bit apprehensive here. My overall philosophy is to not include everything possible, and instead leave more niche use-cases to be open-coded by the user. For a relaxed ordering, I think it might be clearer as well to not use a library for it? At the call-site, with So I am inclined to say that this is out of scope for once_cell! |
|
But perhaps it's worth publishing as a separate crate? I don't positively think that this is a bad idea, I am more unsure, and, given once_cell place in the ecosystem, I have to be very conservative with API extensions. Doing a separate crate removes the uncertainly angle, as you don't pay for what you don't have in Cargo.lock! |
|
Yeah, I don't disagree with that. Another issue, even with my own usage, is that I probably need |
Add a variant of
OnceNonZeroUsizethat uses relaxed ordering, for reduced overhead, especially on ARM/AArch64 and other weakly-ordered systems.Examples:
This is pretty much straight copy-pasta from
racetoracerelaxed: