Skip to content

giucamp/density

Repository files navigation

branch build status
master Build StatusBuild statusCoverage Status
develop Build StatusBuild statusCoverage Status

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:
  • 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

Documentation

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.

Support

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.

How to...

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