{
  "slug": "pmwcas",
  "term": "PMwCAS",
  "aliases": [
    "Persistent multi-word compare-and-swap"
  ],
  "definition": "PMwCAS is a lock-free software primitive for atomically and durably updating multiple machine words through persistent operation descriptors.",
  "note": "The durable descriptor decision determines whether interrupted updates roll forward or back. Readers participate in the protocol; allocator recovery precedes descriptor recovery, and allocation ownership must remain recoverable. Ordinary pointer stores bypass that contract. [pmwcas-paper]\n\nIn the inspected SFU fork, EMU selects PMEM and PMEMEMU while also printing a PMDK diagnostic. Accepted configuration is not proof of a successful full build. [pmwcas-build] [pmwcas-callback]",
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "A successful volatile-mode test does not establish persistence or recovery after power loss.",
      "citationIds": [
        "pmwcas-build"
      ]
    }
  ],
  "related": [
    "bztree",
    "persistent-memory",
    "crash-consistency",
    "persistence-ordering",
    "durable-linearizability"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-13",
  "citations": [
    {
      "id": "pmwcas-paper",
      "title": "Wang, Levandoski and Larson. Easy Lock-Free Indexing in Non-Volatile Memory. ICDE 2018, sections III-V.",
      "url": "https://justinlevandoski.io/papers/ICDE18_mwcas.pdf",
      "accessed": "2026-11-13"
    },
    {
      "id": "pmwcas-build",
      "title": "SFU PMwCAS, revision 3ed419f: backend definitions and EMU diagnostic.",
      "url": "https://github.com/sfu-dis/pmwcas/blob/3ed419f34e1d2a5c19a4d059007982b212bf06a1/CMakeLists.txt",
      "accessed": "2026-11-13"
    },
    {
      "id": "pmwcas-callback",
      "title": "SFU PMwCAS, revision 3ed419f: unimplemented PMEM-without-PMDK callback branch.",
      "url": "https://github.com/sfu-dis/pmwcas/blob/3ed419f34e1d2a5c19a4d059007982b212bf06a1/src/mwcas/mwcas.h#L119-L130",
      "accessed": "2026-11-13"
    },
    {
      "id": "hesela-pmem",
      "title": "Hesela: BzTree recovery and reproducible backend-selection evidence.",
      "url": "https://hesela.com/analyses/pmem-persistence-domains-dax/#bztree-recovery",
      "accessed": "2026-11-13"
    }
  ],
  "provenance": [
    "Source review and a replayed CMake configuration-fragment probe; no full index build, runtime experiment or power-cut test."
  ]
}
