Note:
This is my implementation of the cpp coroutine.
For coroutine, pls refer to http://en.wikipedia.org/wiki/Coroutine).
Actually, when I study the google's go program language(golang).
I find the goroutine(golang's coroutine) and channel are very elegance program concept.
So, I want to implement them in cpp :).
Currently, it's just a toy code,and it's very interesing,
but it's not very easy to undertand as the normal code,as they can jump between the function stack.
I use the classic producer-consumer as an example to verify my implementation.
Build:
- Make
Usage:
- ./main