top | item 45357480

(no title)

ibraheemdev | 5 months ago

It does make a difference of course if you're running fetch_max from multiple threads, adding a load fast-path introduces a race condition.

discuss

order

masklinn|5 months ago

Does it tho? Assuming no torn reads/writes at those sizes, given the location should be strictly increasing are there situations where you could read a higher-than-stored value which would cause skipping a necessary update?

Afaik on all of x86, arm, and riscv an atomic load of a word sized datum is just a regular load.

gpderetta|5 months ago

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.