Taskori is a single-header, dependency-aware, thread-safe job scheduler for C++. It is designed to provide easy-to-use parallel task management for applications such as game engines, simulations, or any multithreaded workloads.
Single-header, minimal dependencies.
Supports job priorities.
Handles job dependencies.
Thread-safe task stealing for load balancing.
Safe integration with std::future to get job results.
Works with multiple worker threads.
Simply include the header:
#include "taskori.h"To get the project up and running, you'll need to follow the setup instructions for your platform.
- Navigate to the
Scriptsfolder in the project directory. - Run the Setup-Windows.bat batch file.
-
Navigate to the
Scriptsfolder in the project directory. -
Make the
Setup-Linux.shscript executable:chmod +x Setup-Linux.sh
-
Run the script to install necessary dependencies and set up the project:
./Setup-Linux.sh
No external dependencies are required besides the C++ Standard Library (C++17 recommended).
#include "taskori.h"
#include <iostream>
#include <chrono>
int main() {
// Create a scheduler with 4 worker threads
taskori::Scheduler sched(4);
// Submit jobs
auto job1 = sched.Submit([] { std::cout << "Job 1 running\n"; });
auto job2 = sched.Submit([] { std::cout << "Job 2 running\n"; }, 1, {job1}); // dependent on job1
auto job3 = sched.Submit([] { std::cout << "Job 3 running\n"; }, 1, {job1, job2});
// Wait for all jobs to complete
sched.WaitAll();
std::cout << "All jobs completed!\n";
}Output (order respects dependencies):
Job 1 running
Job 2 running
Job 3 running
All jobs completed!