Skip to content

Commit db9f162

Browse files
committed
tweaks to PTMs
1 parent 27c20d2 commit db9f162

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ If you just want to use OneFile in your own application or benchmarks then follo
4040
- Include the header from a single .cpp. If you include from multiple compilation units (.cpp files) then move the last block in the .hpp to one of the .cpp files.
4141
- If you want a data structure that is already made then take a look at what's on these folders:
4242

43-
datastructures/ Data structures for volatile memory (needs one of the STMs)
44-
pdatastructures/ Data structures for persistent memory (needs one of the PTMs)
43+
datastructures/ Data structures for volatile memory (needs one of the STMs)
44+
pdatastructures/ Data structures for persistent memory (needs one of the PTMs)
4545

4646

4747
### Design ###
@@ -153,4 +153,4 @@ The four implementations of OneFile were executed during thousands of cpu hours
153153
If you see a crash or invariant failure, run the same code under a global rw-lock to make sure the bug is not in your code. If you really believe it's in OneFile, then please open a bug on github and add as much information as you can, namely, stack trace and files needed to reproduce.
154154
We'll do our best to address it.
155155

156-
156+

ptms/OneFilePTMLF.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,15 +793,15 @@ class OneFileLF {
793793
if (debug) printf("Applying %ld stores in write-set\n", writeSets[tid].numStores);
794794
writeSets[tid].apply(seq, tid);
795795
writeSets[tid].flushModifications();
796-
const uint64_t newReq = seqidx2trans(seq+1,idx);
797-
if (opd.pWriteSet->request.load(std::memory_order_acquire) == lcurTx) {
796+
if (opd.pWriteSet->request.load() == lcurTx) {
797+
const uint64_t newReq = seqidx2trans(seq+1,idx);
798798
opd.pWriteSet->request.compare_exchange_strong(lcurTx, newReq);
799799
}
800800
}
801801

802802
// Upon restart, re-applies the last transaction, so as to guarantee that
803803
// we have a consistent state in persistent memory.
804-
// This is not needed on x86, where the DCAS has atomicity writting to persistent memory.
804+
// This is not used on x86 because the DCAS has atomicity writting to persistent memory.
805805
void recover() {
806806
uint64_t lcurTx = curTx->load(std::memory_order_acquire);
807807
opData[trans2idx(lcurTx)].pWriteSet->applyFromRecover();

ptms/OneFilePTMWF.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,8 @@ class OneFileWF {
10591059
if (debug) printf("Applying %ld stores in write-set\n", writeSets[tid].numStores);
10601060
writeSets[tid].apply(seq, tid);
10611061
writeSets[tid].flushModifications();
1062-
const uint64_t newReq = seqidx2trans(seq+1,idx);
1063-
if (opd.pWriteSet->request.load(std::memory_order_acquire) == lcurTx) {
1062+
if (opd.pWriteSet->request.load() == lcurTx) {
1063+
const uint64_t newReq = seqidx2trans(seq+1,idx);
10641064
opd.pWriteSet->request.compare_exchange_strong(lcurTx, newReq);
10651065
}
10661066
}
@@ -1093,7 +1093,7 @@ class OneFileWF {
10931093

10941094
// Upon restart, re-applies the last transaction, so as to guarantee that
10951095
// we have a consistent state in persistent memory.
1096-
// This is not needed on x86, where the DCAS has atomicity writting to persistent memory.
1096+
// This is not used on x86 because the DCAS has atomicity writting to persistent memory.
10971097
void recover() {
10981098
uint64_t lcurTx = curTx->load(std::memory_order_acquire);
10991099
opData[trans2idx(lcurTx)].pWriteSet->applyFromRecover();

0 commit comments

Comments
 (0)