Arduino Multi-Threading Library « KwartzLab Makerspace. One of the things that I’ve always wished I could do with my Arduino is writing programs that can do multiple tasks independently of each other.
Unfortunately, the Arduino doesn’t support multi-threading. Instead, I’ve written a library to provide crude multi-threading support. Jlamothe/mthread. Protothreads - Lightweight, Stackless Threads in C. Protothreads are extremely lightweight stackless threads designed for severely memory constrained systems, such as small embedded systems or wireless sensor network nodes.
Protothreads provide linear code execution for event-driven systems implemented in C. Protothreads can be used with or without an underlying operating system to provide blocking event-handlers. Protothreads provide sequential flow of control without complex state machines or full multi-threading.