Skip to content

cloudwu/coroutine

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Made tiny change on include section to adapt compile on OSX
a626303

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
February 19, 2014 19:19
July 23, 2012 21:18
July 23, 2012 21:40
July 23, 2012 21:18
July 23, 2012 21:18

It's an asymmetric coroutine library (like lua).

You can use coroutine_open to open a schedule first, and then create coroutine in that schedule.

You should call coroutine_resume in the thread that you call coroutine_open, and you can't call it in a coroutine in the same schedule.

Coroutines in the same schedule share the stack , so you can create many coroutines without worry about memory.

But switching context will copy the stack the coroutine used.

Read source for detail.

Chinese blog : http://blog.codingnow.com/2012/07/c_coroutine.html

About

A asymmetric coroutine library for C.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published