libthreadable-tests/0.2.1

[full]

libthreadable ; tests

TLDR

libthreadable is a C++ library for cache-aware, concurrent task execution using
a thread pool with lock-free queues. It simplifies parallel programming by managing
threads and task distribution for performance-critical applications.

Example

#include <threadable/pool.hxx>

int main() {
  // thread pool:
  auto  pool  = fho::pool();
  auto& queue = pool.create();
  auto  token = queue.emplace_back( []() { cout << "task executed!\n"; });
  token.wait();

  // generic ring buffer:
  auto ring = fho::ring_buffer<int>();
  ring.emplace_back(1);
  ring.emplace_back(2);
  ring.emplace_back(3);
  assert(ring.size() == 3);

  for (auto v : ring)
  {
    cout << format("{}\n", v); // prints 1 2 3
  }
  assert(ring.size() == 3);

  for (auto v : ring.consume())
  {
    cout << format("{}\n", v); // prints 1 2 3
  }
  assert(ring.size() == 0);

  return 0;
}
... More
version 0.2.1
license MITMIT License
repository https://pkg.cppget.org/1/alpha
download libthreadable-tests-0.2.1.tar.gz
sha256 92a806378408a978b0bb207e3fe9995f28643ea9bdd4e2030361c90e97927047
project threadable
url github.com/helmesjo/threadable

Depends (1)

doctest ^2.4.7

Reviews

fail 0
pass 0