Hacker News new | past | comments | ask | show | jobs | submit login

I have an implementation of nested coroutines for C in this file:

https://github.com/billziss-gh/winfuse/blob/master/src/winfu...

This uses the macros coro_block to introduce a new coroutine block, coro_await to invoke a nested coroutine, coro_yield to suspend the coroutine block and coro_break to exit it.

The implementation is fairly simple in about 17 lines of code (omitting file headers/comments). I use it extensively in the implementation of a Windows kernel driver that implements the FUSE protocol (work in progress).

https://github.com/billziss-gh/winfuse

EDIT: For an example use see the implementation of READ:

https://github.com/billziss-gh/winfuse/blob/d44307105b0f1a56...




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: