Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

From: Jonas Oberhauser
Date: Wed Sep 25 2024 - 06:12:32 EST




Am 9/25/2024 um 12:02 PM schrieb Boqun Feng:
Hi Jonas,

Of
course, if we are really worried about compilers being too "smart"

Ah, I see you know me better and better...

we can always do the comparison in asm code, then compilers don't know
anything of the equality between 'ptr' and 'head - head_offset'.
Yes, but then a simple compiler barrier between the comparison and returning ptr would also do the trick, right? And maybe easier on the eyes.


Have fun,
jonas