Skip to content

Instantly share code, notes, and snippets.

@mandel59
Created January 25, 2012 04:33
Show Gist options
  • Save mandel59/1674746 to your computer and use it in GitHub Desktop.
Save mandel59/1674746 to your computer and use it in GitHub Desktop.
spawns 10 tasks
use std;
fn main() {
int::range(0, 10) {|i|
task::spawn {||
std::io::println(#fmt("child: %d", i));
};
std::io::println(#fmt("spawned: %d", i));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment