Skip to content

RFC: Replace ports with pipes #2851

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
eholk opened this issue Jul 9, 2012 · 4 comments
Closed

RFC: Replace ports with pipes #2851

eholk opened this issue Jul 9, 2012 · 4 comments
Labels
A-concurrency Area: Concurrency A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@eholk
Copy link
Contributor

eholk commented Jul 9, 2012

This is mostly just a tracking issue to hang other bugs off of. Assuming we can write all the programs we need to with pipes instead of ports and chans, we should replace the port/chan system with pipes.

@eholk
Copy link
Contributor Author

eholk commented Jul 25, 2012

Pipes are not an exact match, but with things like stream, port_set and shared_chan, we have reasonable replacements for most of the chan/port idioms. All that remains now is finding all the code and rewriting it.

The way pipes interact with native code will be tricky.

@graydon
Copy link
Contributor

graydon commented Aug 9, 2012

@eholk could you clarify what you mean by the last comment ("the way pipes interact with native code will be tricky")?

Otherwise I agree, it sounds like pipes are overall superior in most ways to the older ports and channels, I'm happy to switch to them.

@eholk
Copy link
Contributor Author

eholk commented Aug 9, 2012

@graydon Ports have a representation in the runtime, which means native code could call rust_port::send, or whatever the appropriate method is if they want to deliver a message to a Rust task. As far as I know, this was never done.

The tricky part that pipes would actually need to handle now is in core::priv, where we store a chan casted as a pointer in a global variable in the runtime. This is how we can have a single task to manage, for example, the OS environment, but any task can get access to it at any time.

With pipes, this is problematic for a couple reasons. First off, we can't just cast a pipe to a pointer, because they are not word sized anymore. Pipes can't directly be shared, although we could use pipes::shared_chan to emulate this. In my mind, the hardest issue is that someone needs to run the destructor on the pipe that somehow got stored in global memory. I guess this could just be the OS environment task (or the equivalent task for libuv).

@brson
Copy link
Contributor

brson commented Feb 5, 2013

Done.

@brson brson closed this as completed Feb 5, 2013
@eholk eholk removed their assignment Jun 16, 2014
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Output the tagged version in the `versioning` step of the release
workflow to avoid a failure in the posterior docker build step (see
rust-lang#2851 for more details).

This has been tested in my fork, where:
1. Pushing the `kani-0.40.0` without any changes generated the same
failure [in this
run](https://github.com/adpaco-aws/rmc/actions/runs/6738081085/job/18317679294)
2. Committing the change in this PR and pushing the `kani-0.40.0` again
resulted in a successful build [in this
run](https://github.com/adpaco-aws/rmc/actions/runs/6738159804/job/18317924214)
3. The tagged image can be downloaded from my fork, as seen
[here](https://github.com/adpaco-aws/rmc/pkgs/container/kani-ubuntu-20.04).

Resolves rust-lang#2851
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: Concurrency A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Projects
None yet
Development

No branches or pull requests

3 participants