事务内存
【1】
DUDETM: Building Durable Transactions with Decoupling for Persistent Memory
Introduction
undo logging
In undo logging, the original (old) values are stored to a log before they are modifified by a transaction. Having its old value preserved in the log, the data can be modified in-place. Therefore, a memory load can directly read the latest value without being intercepted and remapped to a different address.
为何undo logging可以避免很大的开销呢,因为针对一个数据写入,它先写入日志,再写入状态机,这样的话,数据读可以直接读到最新的数据(不像redo logging,当把全部数据写入的日志都持久化之后,才写入状态机);但是undo logging有一个问题:
To enforce this order, the system uses the persist operation, which is implemented by a sequence of instructions , for every update.
redo logging
However, since the data updates are buffered in the log, the reads of them in a transaction must be remapped to the log to obtain the latest values.
The dilemma between undo and redo logging is essentially a trade-off between persist ordering cost and update redirection cost.
The key insight of our solution is decoupling a durable transaction into three fully asynchronous* steps.
(1) Perform: execute the transaction in a shadow memory , and produce a redo log for the transaction.
(2) Persist: flflush the redo log of each transaction to persistent memory in an atomic manner.
(3) Reproduce: modify original data in persistent memory according to the persisted redo log. It is essential that we never directly write back dirty data from shadow memory to persistent memory – all the updates are realized via the redo log.
问题
- 为什么“However, since the data updates are buffered in the log, the reads of them in a transaction must be remapped to the log to obtain the latest values.”
 
引用
【1】初识事务内存(Transactional Memory):https://zhuanlan.zhihu.com/p/151425608