nowfound

Work · March 11, 2024

AT

Async tasks in 350 lines of C

Tasks are a primitive for asynchronous programming and an alternative to working with threads directly. Instead of creating a thread, performing work, then waiting on it using synchronization primitives, you only define a unit of work and let a scheduler decide when and where to execute it. The threads that the scheduler uses are created once and reused for many tasks throughout the program's lifetime. In most cases, creating and executing a task requires not even a single syscall and is a significantly faster operation than creating a thread, resulting in lower latency. Furthermore, tasks…

In plain words

This C library provides a lightweight task scheduler for asynchronous programming, offering an alternative to manual thread management. Instead of creating individual threads, developers define units of work that a scheduler executes across a reusable thread pool. Tasks incur minimal overhead—often no system calls—making them faster than thread creation with lower latency. The scheduler automatically interleaves tasks from different subsystems, simplifying concurrent code. Written in standard C11 with only POSIX dependencies, it integrates easily into existing projects.

written from the facts on this page · September 2026

From the sources

In the maker’s words, at launch

Tasks are a primitive for asynchronous programming and an alternative to working with threads directly. Instead of creating a thread, performing work, then waiting on it using synchronization primitives, you only define a unit of work and let a scheduler decide when and where to execute it. The threads that the scheduler uses are created once and reused for many tasks throughout the program's lifetime. In most cases, creating and executing a task requires not even a single syscall and is a significantly faster operation than creating a thread, resulting in lower latency. Furthermore, tasks from different subsystems can be automatically interleaved by the scheduler, which is difficult to achieve manually with threads without communication between the subsystems. The library is written in standard C11 and only depends on the C POSIX library. It is designed to be easy to integrate into a project by just copying the header and simple enough to be understood in an afternoon.

More work this month

the category →
  • Let agents source clips from terabytes of your local video

    Work · 18d ago · clipto.com

  • Free local transcription that is 100% Private

    Work · 17d ago · hynote.ai

  • The app store for voice native apps that lives in your notch

    Work · 28d ago · voiceos.com

  • Ask any question, get a video back instantly

    Work · 24d ago · scrimba.com

  • Handle all of the work before, during, and after meetings

    Work · 17d ago · calendly.com

Launched alongside, March 2024

the whole month →
  • Dub.co1,475

    Short links with superpowers

    Dev tools · 2024 · dub.co

  • 3Y
  • Microlaunch1,116

    Launch and get feedback on both the idea and product

    Dev tools · 2024 · microlaunch.net

  • Milestone1,113

    Interactive, gamified product tours for SaaS

    Growth · 2024 · milestoneflow.io

  • Hunted Space1,004

    Insights on Product Hunt launches

    Growth · 2024 · hunted.space

  • Creatie850

    The one-stop product design tool amplified by AI

    AI · 2024 · creatie.ai