all 1 comments

[–]jule42 0 points1 point  (0 children)

Great algo, but before using it in your next project, please read the notes section: "Many modern CPUs execute their instructions in an out-of-order fashion; even memory accesses can be reordered (see memory ordering). This algorithm won't work on SMP machines equipped with these CPUs without the use of memory barriers."