Skip to content

Instantly share code, notes, and snippets.

@eholk
Created June 8, 2012 18:02
Show Gist options
  • Select an option

  • Save eholk/2897294 to your computer and use it in GitHub Desktop.

Select an option

Save eholk/2897294 to your computer and use it in GitHub Desktop.
for uint::range(1u, num_tasks) {|i|
let get_chan = port();
let get_chan_chan = chan(get_chan);
{
let num_chan = num_chan.clone();
futures += [future::spawn {|move num_chan, move get_chan_chan|
let p = port();
get_chan_chan.send(chan(p));
thread_ring(i, msg_per_task, num_chan, p)
}];
}
num_chan = get_chan.recv();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment