I have couple of questions related to the $subject.
- Does pmem support thread-local undo log as mentioned in the article?
- The current pmem multi-threaded transaction handling design is consistent with the above article? Has there been any major design changes?
Hi,
That article wasn't meant as a description of libpmemobj's design but rather an idea how to extend it.
Current API does not allow multiple threads contributing to a single undo-log based transaction. It does
employ a thread-local undo log.
Let me answer your second question with with a famous quote from Jurassic Park:
"your scientists were so preoccupied with whether or not they could that they didn't stop to think if they should."
(not that I call myself a scientist...)
I wrote that blog post wondering about how to implement a cool feature, without stopping to think how such feature could ever be used in practice.
And in hindsight, I don't think undo logs are well suited for parallel processing of data because they require exclusive write access to the logged data
until the transaction is finished, otherwise it would not be possible to perform a runtime abort. This means that all threads that collaborate on a single
transaction would have to wait (or at least not drop the locks) for the transaction to be finished, resulting in questionable scaling.
And so, we've focused on optimizing our thread exclusive undo log transactions, and we supplemented it with a redo log API that enables application
to prepare work in many threads, and then publish that work in a single transaction.
This API lends itself nicely to the modern asynchronous programming (async/await).
I hope this makes sense! If not, I'd like to hear your perspective on the topic.
Piotr