|
|
|
|
|
by wpollock
299 days ago
|
|
> But... we humans can easily conclude this is safe. After the evaluation of list_ref_a.push(5), my_list is still there, and it's still in a valid state. So there is no risk of memory errors when evaluating the second call to push. Is the always true? What with piplining, branch prediction, and maybe asymmetrical NUMA , isn't out of order instructions possible? If so, don't you still need locks or memory barriers to ensure safety? (I am most definitely not an expert, just curious.) |
|
For example, an Intel CPU won't reorder `x += 1` and `x *= 2`.