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

native::run is useless #18687

Closed
huonw opened this issue Nov 6, 2014 · 1 comment · Fixed by #18967
Closed

native::run is useless #18687

huonw opened this issue Nov 6, 2014 · 1 comment · Fixed by #18967

Comments

@huonw
Copy link
Member

huonw commented Nov 6, 2014

The current implementation is

/// Executes a procedure on the current thread in a Rust task context.
///
/// This function has all of the same details as `start` except for a different
/// number of arguments.
pub fn run(main: proc()) -> int {
    main();
    os::get_exit_status()
}

which is very different to start. It seems it should either be removed, or be adjusted to actually run main inside a Rust context.

(I guess this may be changing dramatically with IO removal.)

cc @aturon, @alexcrichton

@huonw huonw added the A-libs label Nov 6, 2014
@alexcrichton
Copy link
Member

Yes I have a feeling that this function has not stood up well to the test of time. I think that libnative itself is slated for removal shortly after the rtio removal, so this will probably just go away with that.

aturon added a commit to aturon/rust that referenced this issue Nov 21, 2014
With runtime removal complete, there's nothing left of libnative. This
commit removes it.

Fixes rust-lang#18687

[breaking-change]
bors added a commit that referenced this issue Nov 21, 2014
This PR completes the removal of the runtime system and green-threaded abstractions as part of implementing [RFC 230](rust-lang/rfcs#230).

Specifically:

* It removes the `Runtime` trait, welding the scheduling infrastructure directly to native threads.

* It removes `libgreen` and `libnative` entirely.

* It rewrites `sync::mutex` as a trivial layer on top of native mutexes. Eventually, the two modules will be merged.

* It hides the vast majority of `std::rt`.

This completes the basic task of removing the runtime system (I/O and scheduling) and components that depend on it. 

After this lands, a follow-up PR will pull the `rustrt` crate back into `std`, turn `std::task` into `std::thread` (with API changes to go along with it), and completely cut out the remaining startup/teardown sequence. Other changes, including new [TLS](rust-lang/rfcs#461) and synchronization are in the RFC or pre-RFC phase.

Closes #17325
Closes #18687

[breaking-change]

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants