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

Yielding Behaviours #27

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

marioskogias
Copy link
Collaborator

This draft PR enables long running behaviours to yield their execution and let other behaviours run. When a behaviour yields its acquired cowns are not released, thus the causality guarantees are maintained.

A behaviour can yield in two main ways:

  • In the first way, the programmer is in charge of capturing the necessary state inside the acquired cowns. In this case, when the behaviour resumes, it resumes from the beginning and the programmer needs to ensure the correct execution, e.g. by implementing a state machine. An example of this functionality can be seen in the yield.cc test.
  • In the second way, we leverage C++ coroutines to capture the behaviour state. Thus, when the behaviour resumes, it resumes at the exact point it yielded and the compiler is in charge of state capturing.

The goal of this PR is to serve as a conversation starter on whether such a functionality is interesting for verona and not to be merged as is.

This is work done with Musa Unal ([email protected])

@marioskogias
Copy link
Collaborator Author

@m8

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.

2 participants