一句话:将持久软件事务内存(PSTM)原生集成进 Haskell 运行时,原子管理持久数据并兼容惰性求值与垃圾回收。
持久内存支持以内存速度进行字节粒度持久访问,但故障一致性要求不同于易失内存的写语义。现有面向 C/C++ 的持久事务库方案无法在自动内存管理语言中保持高层抽象。本文把持久软件事务内存(PSTM)紧密集成到 Haskell 运行时,用扩展 STM 的接口与语义原子管理持久事务数据类型。该集成保留垃圾回收与分配策略,并完全兼容 Haskell 惰性执行模型。实现性能与底层库相当,现有 STM 库可轻松移植,并支持持久 memoization 与持久 Haskell 表达式等用例。
Emerging persistent memory in commodity hardware allows byte-granular accesses to persistent state at memory speeds. However, to prevent inconsistent state in persistent memory due to unexpected system failures, different write-semantics are required compared to volatile memory. Transaction-based library solutions for persistent memory facilitate the atomic modification of persistent data in languages where memory is explicitly managed by the programmer, such as C/C++. For languages that provide extended capabilities like automatic memory management, a more native integration into the language is needed to maintain the high level of memory abstraction. It is shown in this paper how persistent software transactional memory (PSTM) can be tightly integrated into the runtime system of Haskell to atomically manage values of persistent transactional data types. PSTM has a clear interface and semantics extending that of software transactional memory (STM). Its integration with the language’s memory management retains features like garbage collection and allocation strategies, and is fully compatible with Haskell's lazy execution model. Our PSTM implementation demonstrates competitive performance with low level libraries and trivial portability of existing STM libraries to PSTM. The implementation allows further interesting use cases, such as persistent memoization and persistent Haskell expressions.
@article{paperbot1116,
title = {Persistent software transactional memory in Haskell},
author = {Nicolas Krauter and Patrick Raaf and Peter Braam and Reza Salkhordeh and Sebastian Erdweg and André Brinkmann},
journal = {Proceedings of the ACM on Programming Languages},
volume = {5},
number = {ICFP},
year = {2021},
doi = {10.1145/3473568}
}