http://libmill.org/index.html
[libmill]
Go-style concurrency in C
* Home
* Download
* Tutorial
* Documentation
* Development
Libmill is a library that introduces Go-style concurrency to C.
It can execute up to 20 million coroutines and 50 million context
switches per second.
Go C
go foo(arg1, arg2, arg3) go(foo(arg1, arg2, arg3));
ch := make(chan int) chan ch = chmake(int, 0);
ch := make(chan int, 1000) chan ch = chmake(int, 1000);
ch <- 42 chs(ch, int, 42);
i := <- ch int i = chr(ch, int);
close(ch) chdone(ch, int, 0);
chclose(ch);
select { choose {
case ch <- 42: out(ch, int, 42):
foo() foo();
case i := <- ch: in(ch, int, i):
bar(i) bar(i);
default: otherwise:
baz() baz();end
} }
If you would prefer the same functionality with C-idiomatic API check
libdill.
Libmill is licensed under MIT/X11 license.