Skip to content

Hamdor/task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taski

Reliability Rating Maintainability Rating Security Rating Coverage

Simple task scheduler, taski has support for work-stealing and work-sharing. Taski requires C++17, for an older version which only requires C++14, please use ff7c808.

Supported Compilers

  • GCC >= 7.2.0
  • Clang with support for C++17

Example

// test.cpp
#include <iostream>
#include "taski/all.hpp"

int main() {
  // number of workers -------------+
  //                                |
  // scheduling policy ------+      |
  //                         |      |
  taski::scheduler<taski::stealing, 4> scheduler;
  auto future = scheduler.enqueue([](auto i) {
    return i + 1;
  }, 42);
  std::cout << "future: " << future.get() << std::endl;
}

Compile with: g++ -std=c++17 -Iinclude test.cpp

Taski's enqueue function returns a std::future if the given function has a return type. Otherwise run returns a std::future<void>.

About

Simple task scheduler

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published