Port future to pipes. Graph500 is about 21% faster now.

Making all tests pass.
This commit is contained in:
Eric Holk
2012-07-02 19:03:11 -07:00
parent e5c9cb2b3d
commit 89bdd481e5
3 changed files with 112 additions and 24 deletions

View File

@@ -308,11 +308,21 @@ fn future_result(builder: builder) -> future::future<task_result> {
fn future_task(builder: builder) -> future::future<task> {
//! Get a future representing the handle to the new task
let mut po = comm::port();
let ch = comm::chan(po);
do add_wrapper(builder) |body| {
fn~() {
comm::send(ch, get_task());
import future::future_pipe;
let (po, ch) = future_pipe::init();
let ch = ~mut some(ch);
do add_wrapper(builder) |body, move ch| {
let ch = { let mut t = none;
t <-> *ch;
~mut t};
fn~(move ch) {
let mut po = none;
po <-> *ch;
future_pipe::server::completed(option::unwrap(po),
get_task());
body();
}
}