zserge/pt — explained in plain English
Analysis updated 2026-08-04 · repo last pushed 2016-12-13
Run a firmware loop that polls buttons, services a serial port, and updates a display without an RTOS.
Build a producer/consumer system where one task fills a queue and another drains it without either blocking.
Juggle multiple jobs on a microcontroller like blinking an LED while reading a sensor.
Prototype cooperative multitasking on Linux before deploying to a small device.
| zserge/pt | portbuster1337/lpe-toolkit | fractalfir/crustc | |
|---|---|---|---|
| Stars | 308 | 328 | 331 |
| Language | C | C | C |
| Last pushed | 2016-12-13 | 2026-07-07 | — |
| Maintenance | Dormant | Active | — |
| Setup difficulty | easy | moderate | hard |
| Complexity | 3/5 | 4/5 | 5/5 |
| Audience | developer | ops devops | developer |
Figures from each repo's GitHub metadata at analysis time.
Just include the single header file in your C project, no external dependencies or build configuration needed.
pt is a tiny C library that lets a single piece of code pause itself and pick up later right where it left off. This is useful when a small device needs to juggle several jobs at once, like reading a sensor while also blinking an LED, without the overhead of a full operating system. Normally in C, a function runs from top to bottom and then it's done. This library gives you functions that can hit a "wait" point, return to the caller, and resume from that exact spot the next time they're called. You alternate between several of these functions in a loop, and each one makes progress without blocking the others. The README includes a producer/consumer example: one function fills a shared queue when data is ready, another drains it, and neither ever gets stuck waiting. The target audience is embedded developers working on microcontrollers like STM32, AVR, or MSP430, where memory is tight and you can't afford real threads or a full task scheduler. It also runs on Linux if you want to prototype there. A concrete use case is a firmware loop that polls buttons, services a serial port, and updates a display, all from one main loop with no RTOS. What makes it notable is how minimal it is: one header file, 178 lines, nine API functions, and no dynamic memory allocation. It ships with a compact message queue so cooperating tasks can pass data to each other. Compared to similar libraries, it offers a pt_loop construct that runs non-blocking work while waiting, and it stays neutral about scheduling, you decide whether to call tasks in round-robin fashion, nest them, or build something custom. It's MIT-licensed and works in proprietary projects.
A tiny C library that lets functions pause and resume later, so small devices can run several tasks at once without a full operating system or real threads.
Mainly C. The stack also includes C.
Dormant — no commits in 2+ years (last push 2016-12-13).
Use freely for any purpose, including commercial and proprietary projects, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.