Created
January 25, 2012 04:33
-
-
Save mandel59/1674746 to your computer and use it in GitHub Desktop.
spawns 10 tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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