News for hackers. Stuff that matters.
Re:From Rust to reality: The hidden journey of fetch_max by gpderetta on Wednesday September 24, 2025 @06:47AM (#45358594)
It doesn't need to be strictly increasing some other thread could be making other arbitrary operations. Still even in that case, as Dylan16807 pointed out, it likely doesn't matter.
Re:From Rust to reality: The hidden journey of fetch_max by masklinn on Wednesday September 24, 2025 @10:17AM (#45360771)
> It doesn't need to be strictly increasing some other thread could be making other arbitrary operations

We're talking about collating a maximum, by definition every write to that is an increase.

Re:From Rust to reality: The hidden journey of fetch_max by gpderetta on Wednesday September 24, 2025 @10:19AM (#45360812)
If you are implementing a library function atomic<T>::fetch_max, you cannot assume that every other thread is also performing a fetch_max on that object. There might be little reason for it, but other operations are allowed so the the sequence of modifications might not be strictly increasing (but then again, it doesn't matter for this specific optimization).