2011-07-29 22:09:25 -07:00
|
|
|
use std;
|
2011-08-11 16:36:20 -07:00
|
|
|
import std::ivec;
|
2011-07-29 22:09:25 -07:00
|
|
|
import std::task;
|
|
|
|
import std::uint;
|
|
|
|
import std::str;
|
|
|
|
|
|
|
|
fn f(n: uint) {
|
|
|
|
let i = 0u;
|
|
|
|
while i < n {
|
|
|
|
task::join(spawn g());
|
|
|
|
i += 1u;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn g() {}
|
|
|
|
|
|
|
|
fn main(args: vec[str]) {
|
|
|
|
|
2011-08-11 21:37:27 -07:00
|
|
|
let iargs = ivec::from_vec(args);
|
|
|
|
let n = if ivec::len(iargs) < 2u {
|
2011-07-29 22:09:25 -07:00
|
|
|
10u
|
|
|
|
} else {
|
2011-08-11 23:36:43 -07:00
|
|
|
uint::parse_buf(str::bytes(iargs.(1)), 10u)
|
2011-07-29 22:09:25 -07:00
|
|
|
};
|
|
|
|
let i = 0u;
|
|
|
|
while i < n {
|
|
|
|
spawn f(n);
|
|
|
|
i += 1u;
|
|
|
|
}
|
|
|
|
}
|