Priority: Major - P3
Affects Version/s: None
There has been some contention between michael.cahill, keith.bostic and alexander.gorrod about when and how to control cases where it's important the order in which updates to different member variables are visible to other threads.
A recent example of this was in
WT-5119, where we added the WT_ORDERED_WRITE macro, which has the same semantic as WT_PUBLISH.
Let's use this ticket to decide how to manage ordering in such cases, and be consistent moving forward.
Some relevant content is in the Intel assembly documentation for sfence, which is how WT_PUBLISH is implemented. Specifically the section:
The SFENCE instruction is ordered with respect to memory stores, other SFENCE instructions, MFENCE instructions, and any serializing instructions (such as the CPUID instruction). It is not ordered with respect to memory loads or the LFENCE instruction.
We have some disagreement about whether an sfence implies that reads will also be ordered in respect to the sfence operation.