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 (umusasadik@gmail.com)
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:
yield.cc
test.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 (umusasadik@gmail.com)