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

Create a WT_WRITE_ONCE macro.

    • Storage Engines
    • 5
    • NachoCheese - 2023-10-03, Joker - StorEng - 2023-10-17, Asparagus-StorEng - 2023-10-31, c(3x10^8)-StorEng - 2023-11-14, 2024-02-20_A_near-death_puffin

      Partner ticket to WT-11285 which adds WT_READ_ONCE.

       
      In WiredTiger the WT_PUBLISH macro is currently used for two purposes:

      1. Providing volatile write semantics which prevents fused writes (taking two write to memory and fusing them into a single write under the hood) and introduced write (taking a single write to memory and converting it into multiple writes under the hood)
      2. Providing write ordering between two variables. Ensuring that if the code says to write variable A before B that neither the compiler nor CPU execution is allowed to optimise the code to instead write B first.

      PM-3221 is splitting these two purposes out into separate macros for clearer readability, and this ticket introduces the WT_WRITE_ONCE macro to handle case 1. Once all uses of WT_PUBLISH to enforce volatile semantics have been updated to use WT_WRITE_ONCE, WT_PUBLISH will be used exclusively to handle case 2.

            Assignee:
            luke.pearson@mongodb.com Luke Pearson
            Reporter:
            luke.pearson@mongodb.com Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: