[GSoC 01] HPX and libcds

Contents

I am glad to see my proposal is accepted by STE||AR Group, and I am eager to make contributions to this community. To push me to focus on my GSoC project, I decide to write a serial article to give a brief introduction to my project.

Firstly, I want to give my understand about HPX, HPX is a library to provide everything you want in HPC (high performance computation). HPX includes most common used parallel algorithms and containers. Especially, some standard STL containers are available in HPX.

STL containers such as vectors/maps/sets/etc are not thread safe. One cannot safely add or remove elements from one of these containers in one thread, while iterating or adding/removing in another thread without potentially catastrophic consequences (usually segmentation faults leading to eventual program failure). So these containers must upport concurrent access. Some work has begun on implementing concurrent structures in HPX, a concurrent unordered map with reader/writer lock and a partial implementation of concurrent vector exist, but they have not all been completed, do not have unit tests and need to be unified into an hpx::concurrent namespace. On the other hand, this lock based implementations are low efficiency, we hope to make use of lock free tech to complete our libraries.

A number of libraries implementing thread safe (sometimes lockfree) containers already exist that can be used for ideas and where code uses a boost compatible license can be integrated into HPX. The aim of the project is to collect as much information and as many implementations of threads safe containers and create or integrate them into the HPX library.

Fortunately, we find an open source library named libcds. Moreover, we get the authorization to migrate these containers to our namespace.

libcds is a data structure library including queue, stack, priority queue, binary tree, list, hash table, hash map, etc. Al these data structures are lock-free and have more than one implementation by using different algorithms.

[References]

  1. http://stellar-group.org/libraries/hpx/
  2. https://github.com/khizmax/libcds
  3. https://www.boost.org/
  4. http://stellar-group.org/2018/04/gsoc-2018-participants-announced/