boostorg / boostorg/cobalt

ring_buffer

Open
#233 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
347
Forks
47
Avg merge
3d 8h
Merged PRs (30d)
1

Description

A ring_buffer could be useful in situations where one wants a channel but back-pressure would be an issue.

It should have the same API as a channel.

On write, the writing coroutine should be yield to a reading coroutine if present.
If the ring-buffer is full the awaiting coroutine should post it-self to avoid starvation.

The ring_buffer could also have a `post` function, that posts a value and then the completion.
This function could also be thread-safe (since it posts internally) allowing for cross-thread notifications.

`T = void` would be a notifier, especially when of size 1.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.