Skip to content

Combine channels/ports. Allow multiple receivers #2158

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

Closed
brson opened this issue Apr 8, 2012 · 2 comments
Closed

Combine channels/ports. Allow multiple receivers #2158

brson opened this issue Apr 8, 2012 · 2 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@brson
Copy link
Contributor

brson commented Apr 8, 2012

Channels could combine the properties of channels and ports, be sendable types and allow multiple senders and receivers.

@pcwalton has suggested that this is what go does and it would seem to make channels more usable.

Likely requires copy constructors and a type that is both sendable and has destructors.

This is possibly at odds with #2157.

@graydon
Copy link
Contributor

graydon commented Apr 10, 2012

It's possible but I'm ... generally wary of this. Or at least ambivalent. Go is not the only language that does what it does, there are dozens of languages that experiment in this space. Rust's channels are half-duplex by design, following Erlang's lead. Making them full duplex means:

  • reduced implementation leeway; you have fewer options on how to implement / optimize. It pretty much has to be an atomically refcounted deque with a lock on its body.
  • increased inter-task synchronization on all operations; fewer chances to get the locks out of the path
  • less clear ownership of in-flight data
  • channels no longer weak, more stuff accidentally kept alive
  • a dead consumer task no longer means data drops on the floor; it buffers forever instead

Possibly the ownership and buffer/drop (and sync/async) issues can be addressed with a richer channel API. I'm not sure the implementation flexibility or performance issues can be.

@brson
Copy link
Contributor Author

brson commented Jul 31, 2012

This is not the direction we are going. Closing.

@brson brson closed this as completed Jul 31, 2012
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
Avoid error patterns matching themselves

fixes rust-lang#2156
fixes rust-lang/miri#2155

this will be obsolete the moment I extract that data from json diagnostics instead of just regexing the stderr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants