Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. libfork

libfork

MPL-2.0C++v3.8.0

A lock-free, wait-free, continuation-stealing tasking library for C++20 built on coroutines, enabling ultra-fine-grained parallelism.

Visit WebsiteGitHubGitHub
901 stars46 forks0 contributors

What is libfork?

libfork is a C++20 tasking library that implements strict fork-join parallelism using coroutines. It provides a lock-free, wait-free, continuation-stealing runtime for writing highly concurrent tasks with minimal overhead. The library solves the problem of achieving fine-grained parallelism in C++ without relying on traditional threading primitives.

Target Audience

C++ developers building high-performance parallel applications, such as numerical computing, simulation, or game engines, who need efficient task scheduling with low overhead.

Value Proposition

Developers choose libfork for its ultra-low task spawning overhead, NUMA-aware schedulers, and strict fork-join model that ensures safety and scalability. It outperforms libraries like OneTBB, OpenMP, and TaskFlow in both speed and memory efficiency.

Overview

A bleeding-edge, lock-free, wait-free, continuation-stealing tasking library built on C++20's coroutines

Use Cases

Best For

  • Implementing recursive parallel algorithms like Fibonacci or tree searches
  • Building high-performance numerical computing applications
  • Creating fine-grained task-based parallelism in game engines
  • Developing scalable simulation software with many concurrent tasks
  • Experimenting with C++20 coroutines for parallel programming
  • Optimizing NUMA-aware applications with work-stealing schedulers

Not Ideal For

  • Projects stuck on C++ standards older than C++20, as it relies on coroutines
  • Applications requiring deterministic task execution order, due to non-deterministic work-stealing
  • Teams needing simple, coarse-grained parallelism without fine-tuning or advanced concurrency knowledge
  • Scenarios where tasks must perform blocking operations, as workers should never block

Pros & Cons

Pros

Ultra-Low Task Overhead

Uses a cactus stack with segmented stacks for almost non-allocating task spawning, enabling fine-grained parallelism with overhead as low as 10x a bare function call, per benchmarks.

High Scalability

Lock-free and wait-free design with continuation stealing ensures non-blocking execution and linear scaling across many cores, as demonstrated in performance comparisons.

NUMA-Aware Schedulers

Includes optimized schedulers like lazy_pool and busy_pool for NUMA systems, providing portable performance improvements on modern multi-core hardware.

Header-Only Integration

Zero dependencies and full CMake support, available via package managers like vcpkg and Conan, simplifying adoption in existing projects.

Cons

Complex Exception Handling

Exception safety requires manual management, such as wrapping code in try-catch and calling stash_exception, which is error-prone and violates RAII principles.

Steep Learning Curve

Demands deep understanding of C++20 coroutines, strict fork-join semantics, and library-specific patterns like lf::eventually, making it inaccessible for casual users.

Restrictive Reference Semantics

Bans certain reference conversions to prevent dangling pointers, but this can complicate API usage and lead to subtle bugs if not carefully followed.

Limited Ecosystem Support

As a niche library, it lacks the community tools, extensive documentation, and third-party integrations found in established alternatives like Intel TBB.

Frequently Asked Questions

Quick Stats

Stars901
Forks46
Contributors0
Open Issues8
Last commit5 months ago
CreatedSince 2021

Tags

#work-stealing#threadpool#parallel-computing#high-performance#coroutines#c++20#lock-free#tasking#concurrency#task-graph#scheduler#cpp20#header-only#task-scheduling

Built With

c
c++20
C
CMake

Links & Resources

Website

Included in

C/C++70.6k
Auto-fetched 23 hours ago

Related Projects

concurrentqueueconcurrentqueue

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11

Stars12,525
Forks1,942
Last commit3 months ago
TaskflowTaskflow

A General-purpose Task-parallel Programming System in C++

Stars12,210
Forks1,417
Last commit10 days ago
ThreadPoolThreadPool

A simple C++11 Thread Pool implementation

Stars8,828
Forks2,337
Last commit2 years ago
NCCLNCCL

Optimized primitives for collective multi-GPU communication

Stars5,181
Forks1,452
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub