branch | build status |
---|---|
master | |
develop |
Density is a C++11 header-only library that provides:
- page-based memory management
- concurrency with parametric progression guarantee (blocking, lock-free, wait-free)
- lifo data structures, useful for thread-local temporary data:
- lifo_array, an high-level container similar to variable length arrays of c99
- lifo_buffer, an untyped and resizable buffer
- lifo_allocator, a low-level LIFO allocator
- fifo data structures, useful for inter-thread communication:
concurrency strategy | function queue | heterogeneous queue | Consumers cardinality | Producers cardinality |
---|---|---|---|---|
single threaded | function_queue | heter_queue | - | - |
locking | conc_function_queue | conc_heter_queue | multiple | multiple |
lock-free | lf_function_queue | lf_heter_queue | single/multiple | single/multiple |
spin-locking | sp_function_queue | sp_heter_queue | single/multiple | single/multiple |
The overview should be enough for an effective use of the library.
This pdf document is an alternative overview that describes in detail the implementation of the library.
Of course there is a reference documentation, generated from the master branch. This documentation also includes the results of some benchmarks.
Supported compilers:
- Msc (Visual Studio 2017)
- g++-4.9 and g++-7
- clang++-4.0 and clang++-5.0
The current version has not been tested on achitectures with weak memory ordering, so relaxed atomic operations are disabled with a global compile-time constant. Future versions will exploit relaxed atomics.
The library has an extensive test program that tests all the the data-structure, in normal and exceptional paths. The test program is executed on every commit in the master and develop branches. Anyway the current version is not mature enough for critical production code, and the coverage percentage reported by gcov and coveralls is biased due to some uninstantiated function templates. So: use it for your videogame, but not for heart surgery or landing a plane.
In the issues page you can check the known issues or add some.
The library has no dependencies and is composed only by headers, so there is nothing to build. To use it just download or clone the repository, and then copy the directory "density" in your include paths.
A test program and a benchmark program are included. You can build them using cmake or Visual Studio 2017. Click here for the details.
Feedback to giu.campana@gmail.com