{
  "slug": "bp-wrapper",
  "term": "BP-Wrapper",
  "aliases": [
    "Batching and prefetching wrapper"
  ],
  "definition": "BP-Wrapper is a buffer-management framework that batches replacement-policy updates and prefetches their metadata to reduce lock contention.",
  "note": "The ICDE 2009 design records hits in per-thread FIFO queues. At the batch threshold it tries the policy lock without blocking; a full queue requires acquiring the lock. A miss commits the thread's pending hits before its miss operation. Per-thread order is preserved, not a single immediate global recency order. [bp-wrapper]\n\nPrefetching brings replacement metadata into the processor cache before the critical section; database-page read-ahead is a separate operation. Evaluation used modified PostgreSQL 8.2.3 on two multiprocessor systems, not current PostgreSQL or SSD firmware. [bp-wrapper]\n\nCaffeine cites this work but has a different buffering contract. Its read buffer may reject events under contention or when full. Batching therefore does not, by itself, specify whether observations are retained. [caffeine-buffer]",
  "related": [
    "tinylfu",
    "lru-replacement",
    "cache-admission",
    "two-queue-replacement"
  ],
  "citations": [
    {
      "id": "bp-wrapper",
      "title": "Ding, Jiang and Zhang. BP-Wrapper. ICDE 2009, pp. 369-380, sections III-IV; DOI 10.1109/ICDE.2009.96.",
      "url": "https://web.njit.edu/~dingxn/papers/BP-Wrapper.pdf",
      "accessed": "2026-11-12"
    },
    {
      "id": "caffeine-buffer",
      "title": "Caffeine v3.2.3, BoundedLocalCache.java: concurrency contract, afterRead, drainReadBuffer and onAccess. Commit 5227a98b51e02b4d4fbfc2b0e33c362a138f51b1.",
      "url": "https://github.com/ben-manes/caffeine/blob/5227a98b51e02b4d4fbfc2b0e33c362a138f51b1/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java",
      "accessed": "2026-11-12"
    }
  ],
  "provenance": [
    "Primary-source review of the original paper and pinned library implementation; no new throughput measurement or implementation replication."
  ],
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "Delaying policy bookkeeping can change victim choices without changing the correctness of the buffered data.",
      "citationIds": [
        "bp-wrapper"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-12"
}
