C++ bindings for libpmemobj (part 3) - persistent queue example

C++ bindings for libpmemobj (part 3) - persistent queue example

The best way to learn to code is usually by implementing an example. We are going to be creating a linked-list based queue data structure using the the pmem::obj::p and pmem::obj::persistent_ptr classes and libpmemobj C API. But first, a little bit of CS 101 :) Linked-list queue Queue is a …

Read More
An introduction to pmemobj (part 7) - persistent lists

An introduction to pmemobj (part 7) - persistent lists

The pmemobj library provides non-transactional persistent atomic circular doubly-linked lists (or NTPACDLL for short) API with an interface familiar to anyone who have ever included sys/queue.h header file - it’s in fact so similar that I considered not writing this post at all, you can just …

Read More
An introduction to pmemobj (part 5) - atomic dynamic memory allocation

An introduction to pmemobj (part 5) - atomic dynamic memory allocation

In the previous post I talked about using transactions for allocating new objects, which is fine and is the most similar approach to the standard POSIX way. But it does add an overhead of maintaining an undo log of changes. A more optimal memory management can be achieved using the non-transactional …

Read More
An introduction to pmemobj (part 6) - threading

An introduction to pmemobj (part 6) - threading

All of the pmemobj library functions are thread-safe, with following two exceptions: pool management functions (open, close and friends) and pmemobj_root when providing different sizes in different threads - so as long as you are using this function the way it’s meant to be used you …

Read More
An introduction to pmemobj (part 4) - transactional dynamic memory allocation

An introduction to pmemobj (part 4) - transactional dynamic memory allocation

This is a topic I intentionally avoided not to introduce too much complexity too fast. The pmemobj library contains an implemented from scratch memory allocator, that was designed with persistent memory in mind. There are two separate APIs: non-transactional and transactional. Transactional …

Read More