Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aco_yield_to() #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add aco_yield_to() #32

wants to merge 2 commits into from

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