Skip to content

Conversation

AltraMayor
Copy link

This pull request introduces aco_yield_to() that enables a non-main co to yield to another co with a single context switch.

The first patch, namely add aco_yield_to(), seems a little complicated because part of the code of aco_resume() is moved to a new auxiliary function called aco_own_stack() to avoid duplicating code at aco_yield_to(). Ignoring this code movement, the additions are straightforward.

The second patch adds test_aco_tutorial_7.c to test and show how to use aco_yield_to().

This pull request closes #31

@AltraMayor AltraMayor force-pushed the yield_to branch 4 times, most recently from 95a1567 to e58b7ef Compare October 25, 2019 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request: having a version of aco_yield() that receives the coroutine to where to yield
1 participant