|
1 | 1 | # SPDX-License-Identifier: BSD-3-Clause |
2 | 2 | # Copyright 2021, Intel Corporation |
3 | 3 |
|
4 | | -/** @defgroup containers Containers*/ |
5 | | -/** @defgroup experimental_containers Experimental Containers */ |
| 4 | +/** @defgroup containers Containers |
| 5 | + * Custom (but STL-like) containers for persistent memory. |
| 6 | + * |
| 7 | + * Persistent containers are implemented-from-scratch with optimized on-media layouts |
| 8 | + * and algorithms to fully exploit the potential and features of persistent memory. |
| 9 | + * Besides specific internal implementation details, libpmemobj-cpp persistent memory |
| 10 | + * containers have (where possible) the well-known STL-like interface and they work |
| 11 | + * with STL algorithms. Containers' methods guarantee atomicity, consistency and |
| 12 | + * durability. Note that every single modifier method (any one modifying the state of |
| 13 | + * the container, like resize or push_back) opens transaction internally and guarantees |
| 14 | + * full exception safety (modifications will be either committed or rolled-back |
| 15 | + * if an exception was thrown, or crash happened - for more info see @ref transactions). |
| 16 | + * There is no need for using transaction when calling modifier methods whatsoever. |
| 17 | + * |
| 18 | + * There is a separate Feature describing and listing all |
| 19 | + * experimental containers, see @ref experimental_containers. |
| 20 | + * |
| 21 | + * # Rationale for implementing pmem-aware containers |
| 22 | + * |
| 23 | + * The C++ standard library containers collection is something that persistent |
| 24 | + * memory programmers may want to use. Containers manage the lifetime of held |
| 25 | + * objects through allocation/creation and deallocation/destruction with the use of |
| 26 | + * allocators. Implementing custom persistent allocator for C++ STL (Standard |
| 27 | + * Template Library) containers has two main downsides: |
| 28 | + * |
| 29 | + * Implementation details: |
| 30 | + * - STL containers do not use algorithms optimal from persistent memory programming point of view. |
| 31 | + * - Persistent memory containers should have durability and consistency properties, |
| 32 | + * while not every STL method guarantees strong exception safety. |
| 33 | + * - Persistent memory containers should be designed with an awareness of |
| 34 | + * fragmentation limitations. |
| 35 | + * |
| 36 | + * Memory layout: |
| 37 | + * - The STL does not guarantee that the container layout will remain unchanged in new library versions. |
| 38 | + * |
| 39 | + * Due to these obstacles, the libpmemobj-cpp contains the set of custom, |
| 40 | + * implemented-from-scratch containers with optimized on-media layouts and |
| 41 | + * algorithms to fully exploit the potential and features of persistent memory. |
| 42 | + * These methods guarantee atomicity, consistency and durability. Besides specific |
| 43 | + * internal implementation details, libpmemobj-cpp persistent memory containers |
| 44 | + * have the well-known STL-like interface and they work with STL algorithms. |
| 45 | + * |
| 46 | + * # Additional resources |
| 47 | + * - [Blog post on pmem.io about libpmemobj-cpp persistent containers](https://pmem.io/2018/11/20/cpp-persistent-containers.html) |
| 48 | + * - [A blog post about array container](https://pmem.io/2018/11/02/cpp-array.html) |
| 49 | + * - [Very first description of (then yet experimental) vector container](https://pmem.io/2019/02/20/cpp-vector.html) |
| 50 | + * |
| 51 | + * For curious readers - back then in 2017 - there was an approach to re-use and modify the |
| 52 | + * STL containers to be pmem-aware. Story of implementing this experiment can be found in |
| 53 | + * [the blog post on pmem.io](https://pmem.io/2017/07/10/cpp-containers.html). |
| 54 | + * The repo with that code is now dead, but left for the reference and historical perspective. |
| 55 | + */ |
| 56 | + |
| 57 | +/** @defgroup experimental_containers Experimental Containers |
| 58 | + * PMem containers under development and/or in testing. |
| 59 | + * |
| 60 | + * It's very important to underline: |
| 61 | + * @note **Experimental API may change (with no backward compatibility) |
| 62 | + * and it should not be used in a production environment** |
| 63 | + * |
| 64 | + * A container is considered **experimental** because: |
| 65 | + * - it may not be a 100% functionally ready, |
| 66 | + * - tests are not finished and there might be some gaps/corner cases to be discovered and fixed, |
| 67 | + * - we may still tweak the API (if we find it's not well defined), |
| 68 | + * - its layout may change. |
| 69 | + * |
| 70 | + * For general containers' description please see @ref containers. |
| 71 | + */ |
6 | 72 |
|
7 | 73 | /** @defgroup transactions Transactions |
8 | 74 | * This section introduces transaction feature in libpmemobj-cpp. |
|
0 commit comments