Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11285

Introduce WT_READ_ONCE macro

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.2.0, 7.2.0-rc0
    • 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:

      1. 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)
      2. 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.

            Assignee:
            andrew.morton@mongodb.com Andrew Morton
            Reporter:
            andrew.morton@mongodb.com Andrew Morton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: