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

Channels v2 #265

Open
1 task
ryanolson opened this issue Dec 27, 2022 · 0 comments
Open
1 task

Channels v2 #265

ryanolson opened this issue Dec 27, 2022 · 0 comments
Assignees
Labels
feature request New feature or request

Comments

@ryanolson
Copy link
Contributor

  • BufferedChannel
    • Writes will yield if the channel is at capacity
    • Reads will yield if the channel is empty
    • Writes will preferentially resume awaiting readers
    • In the case a reader is resumed from a writer’s execution context, the writers will be rescheduled on scheduler of the caller’s coroutine or the default scheduler
    • Back pressure is managed by transfer the execution context downstream; upstream is only rescheduled for execution when space exists in the buffer.
    • Enabled pipeline concurrency proprotional allowing upstream and downstream to be co-scheduled
  • ImmediateChannel
    • Writes will suspend if there are no awaiting Readers
    • Reads will suspend if there are no awaiting Writers
    • Awaiting writers holding data are always processed first
    • Suspended writers are put in a FIFO resume linked-list after their data has been consumed
    • If no incoming (writer) data is available, writers are resumed in FIFO ordering from the resume queue
    • Back pressure is managed by transferring the execution context downstream, pausing upstream progress
    • Does not enable pipeline concurrency as the execution context is transferred.
  • RecentChannel
    • Writes will never yield
    • Writes will preferentially resume awaiting readers
    • If the Channel is at capacity, the oldest data at the front of the queue is popped and the newest data is pushed to the back of the queue.
    • Back pressure is managed by dropping oldest data then transferring the execution context downstream with the upstream getting rescheduled
  • NullChannel
    • Writes never yield, immediate drops the data sent to it
    • Read never yield, always returns a channel closed

#262 adds mrc::core::concepts::not_void - all channels should use not_void at minimum

#264 adds the first concrete v2 channel based on coroutines

  • note: type-erasing concrete implementations of channels requires wrapping them in a generic task which has a generic return type
@ryanolson ryanolson added the feature request New feature or request label Dec 27, 2022
@ryanolson ryanolson self-assigned this Dec 27, 2022
@ryanolson ryanolson moved this to Todo in MRC Boards Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
Status: Todo
Status: Todo
Development

No branches or pull requests

1 participant