This directory contains an example libraries implemented using libpmemobj.

To build examples with debug parameters run "make debug".

The *hashmap_tx*, *hashmap_atomic* and *hashmap_rp* libraries are three
implementations of hashmap which utilizes transactional, atomic and
reserve/publish API of libpmemobj respectively.

Libraries may be used through *mapcli* application located in
examples/libpmemobj/map directory.

Atomic version, while simpler on the surface than transactional one,
has 2 significant drawbacks:
- libpmemobj's list API implements only double-linked lists, which wastes
  memory here (we don't need to traverse backward)
and what is more important:
- it needs to handle recovery process after crash/interruption

Transactional version implements its own single-linked lists (it's still not
memory efficient, because every allocation has significant overhead, so to
mitigate it application would have to keep more values in one node) and
can get away without any recovery process - every memory transaction is
either done in 0% or 100%.

Hashmap_rp version uses libpmemobj action interface for reserve/publish
mechanism. While hashmap_tx and hashmap_atomic container implementations
are using separate chaining with linked lists for collisions resolving,
hashmap_rp provides open addressing with Robin Hood collision resolution.
Hashmap_rp built with debug parameter monitors number of swaps performed
for single insertion and calls additional asserts.
