Skip to content

Instantly share code, notes, and snippets.

View Harvie's full-sized avatar
🎯
Focusing

Tomas Mudrunka Harvie

🎯
Focusing
View GitHub Profile
@Harvie
Harvie / context_demo.c
Created January 7, 2022 14:32 — forked from DanGe42/context_demo.c
A non-trivial example of how to use user contexts for trivial scheduling.
#include <ucontext.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <poll.h>
/* ucontext sample program