Hi, experts!
I am writing a concurrent data structures using libpmemobj transactions.
I got the following example from the
book:
52 void increment(pop_type &pop) {
53 auto proot = pop.root();
54 pobj::transaction::run(pop, [&] {
55 proot->counter.get_rw() += 1;
56 }, proot->mtx);
57 }
Here is my understanding:
For two concurrent transactions which are racing to each other, I have to lock the whole transactions to guarantee mutual exclusion and there is no way to use fine-grained locks inside transactions.
Is my understanding correct?
Are there any other PMDK examples using concurrent transactions I can learn from?
Thanks,
-Xinwei
--
Xinwei (Mason) FuPhD student, Computer Science, 2016-?
Virginia Tech