-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Storage Engines
-
5
-
2023-07-25 Absolute unit, StorEng - 2023-08-08, ASeasonTooMany-2023-08-22, BermudaTriangle- 2023-09-05, TheMoon-StorEng - 2023-09-19, NachoCheese - 2023-10-03
In WiredTiger the WT_ORDERED_READ macro is currently used for two purposes:
- Providing volatile read semantics which prevents fused reads (taking two reads from memory and fusing them into a single read under the hood) and introduced reads (taking a single read from memory and converting it into multiple reads under the hood)
- Providing read ordering between two variables. Ensuring that if the code says to read variable A before B that neither the compiler nor CPU execution is allowed to optimise the code to instead read B first.
PM-3221 is splitting these two purposes out into separate macros for clearer readability, and this ticket introduces WT_READ_ONCE macro to handle case 1. Once all uses of WT_READ_ORDERED to enforce volatile semantics have been updated to use WT_READ_ONCE, WT_READ_ORDERED will be used exclusively to handle case 2.