Hacker News new | ask | show | jobs
by JonChesterfield 825 days ago
Looks exactly like one would expect it to. Clear, boring C. Good stuff.

C11 has a <threads> header that should be usable in place of the pthreads api.

2 comments

FWIW, I opened a PR that adds Windows support: https://github.com/rkaehn/cr_task.h/pull/2

I may play with the C11-standard `threads.h`, but note that it was not implemented by MSVC at all until quite recently: https://devblogs.microsoft.com/cppblog/c11-threads-in-visual...

Edit: Made a C11 threads.h implementation as well. https://github.com/rkaehn/cr_task.h/pull/3

I expected it to include yielding, but I'm actually glad it doesn't. This looks like a good base layer to build higher-level abstractions on. Useful stuff.