Skip to content

tripabhi/ConcurrentPlusPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConcurrentPlusPlus

ConcurrentPlusPlus is a C++ library that helps you write parallel programs. The library currently provides the following implementations:

  • deque.h - A fast, lock-free work stealing Deque implementation.
  • threadpool.h - A simple threadpool that can execute tasks in parallel.

Build

To build the project:

mkdir build && cd build
cmake ..
make

Once the project is built, you can run the test suite from build/tests folder. You can either run the tests executable, or you can run ctest.

Usage

To add this library to your project, you can use CPM.cmake to use our project like this:

CPMAddPackage("gh:tripabhi/ConcurrentPlusPlus#1.0.0")

target_link_libraries(${TARGET} ConcurrentPlusPlus::async)

Once the library is added, you can use the ThreadPool class like this:

#include <async/threadpool.h>

int multiply(int a, int b) { return a * b; }

int main() {
  async::ThreadPool pool(4);
  std::future<int> future = pool.submit(multiply, 4, 5);
  assert(future.get() == 20);
}

About

A lightweight C++ Library for parallel programming

Resources

Stars

Watchers

Forks

Packages

No packages published