[src]

Crate native

The native I/O and threading crate

This crate contains an implementation of 1:1 scheduling for a "native" runtime. In addition, all I/O provided by this crate is the thread blocking version of I/O.

Starting with libnative

extern crate native;

#[start]
fn start(argc: int, argv: **u8) -> int { native::start(argc, argv, main) }

fn main() {
    // this code is running on the main OS thread
}

Force spawning a native task

extern crate native;

fn main() {
    // We're not sure whether this main function is run in 1:1 or M:N mode.

    native::task::spawn(proc() {
        // this code is guaranteed to be run on a native thread
    });
}
io

Native thread-blocking I/O implementation

task

Tasks implemented on top of OS threads

lang_start
run

Executes a procedure on the current thread in a Rust task context.

start

Executes the given procedure after initializing the runtime with the given argc/argv.