Concurrent Cache-Oblivious B-Trees Using Transactional Memory
Bradley C. Kuszmaul, Jim Sukha · 2006
Cache-oblivious B-trees for data sets stored in external memory represent an application that can benefit from the use of transactional memory (TM), yet pose several challenges for existing TM implementations. Using TM, a programmer can modify a serial, in-memory cache-oblivious B-tree (CO B-tree) to support concurrent operations in a straightforward manner, by performing queries and updates as individual transactions. In this paper, we describe three obstacles that must be overcome, however, before one can implement an efficient external-memory concurrent CO B-tree. First, CO B-trees must perform input/output (I/O) inside a transaction if the underlying data set is too large to fit in main memory. Many TM implementations, however, prohibit such transaction I/O. Second, a CO B-tree that operates on persistent data requires a TM system that supports durable transactions if the programmer wishes to be able to restore the data to a consistent state after a program crash. Finally, CO B-trees operations generate megalithic transactions, i.e., transactions that modify the entire data structure, because performance guarantees on CO B-trees are only amortized bounds. In most TM implementations, these transactions create a serial bottleneck because they conflict with all other concurrent transactions operating on the CO B-tree. Of these three issues, we argue that a solution for the first two issues of transaction I/O and durability is to use a TM system that supports transactions on memory-mapped data. We demonstrate the feasibility of this approach by using LibXac, a library that supports memory-mapped transactions, to convert an existing serial implementation of a CO B-tree into a concurrent version with only a few hours of work. We believe this approach can be generalized, that memory-mapped transactions can be used for other applications that concurrently access data stored in external memory.