Skip to content

Instantly share code, notes, and snippets.

View prabhakarshah's full-sized avatar

Prabhakar Kumar Shah prabhakarshah

  • tikia.chat
  • San Fransisco
  • 01:15 (UTC -07:00)
View GitHub Profile
@prabhakarshah
prabhakarshah / coro.c
Created July 4, 2020 20:28 — forked from lpereira/coro.c
Simple coroutine implementation in C
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <ucontext.h>
typedef struct coro_t_ coro_t;
typedef struct thread_t_ thread_t;
typedef int (*coro_function_t)(coro_t *coro);
typedef enum {
CORO_NEW,