-
Notifications
You must be signed in to change notification settings - Fork 454
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 an async disruptor/ring-buffer queue abstraction for buffered communication between producer/consumer coroutines #17
Comments
I've added some initial abstractions for this to the 'disruptor' branch: This has the Some simple Still need to add a |
Interesting. I ported the disruptor to C++ about a year ago and found it to be pretty damned good; so long as you use the correct wait_strategy's for your requirements. Can't wait to try this out as we will need a messaging system at some point and if it can work with cppcoro and coroutines, all the better! |
The performance of the coroutine-based wait strategy is not quite going to be able to match that of a spin-wait strategy that avoids any synchronisation other than acquire-reads and release-stores. The coroutine wait-strategy requires a seq_cst memory barrier whenever a coroutine needs to suspend in a This should still be more efficent than a wait-strategy that uses |
This has now been merged (finally). See PR #92 |
…includes Unify experimental includes
We have
async_generator<T>
that can be used for producer/consumer coroutines to communicate, however it has no buffering capability which means that the elements can only be generated and processed one at a time.We should look at something similar to https://github.com/lewissbaker/disruptorplus but that uses
co_await
and coroutine suspension as a wait-strategy for handling the full/empty buffer cases.sequence_barrier
abstraction.I have some code kicking around in a side-project that I can port to cppcoro.
The text was updated successfully, but these errors were encountered: