Skip to content

Commit

Permalink
stop spawning so many tasks in guide-tasks
Browse files Browse the repository at this point in the history
1000 tasks * 2MiB stack size -> 2GiB of virtual memory

On a 64-bit OS, a 32-bit executable has 4GiB available, but the kernel
gets half of the available address space so the limit is 2GiB on 32-bit.

Closes #17044
  • Loading branch information
thestinger committed Sep 16, 2014
1 parent 63eaba2 commit 7ce2ea0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/guide-tasks.md
Expand Up @@ -235,7 +235,7 @@ fn partial_sum(start: uint) -> f64 {
}
fn main() {
let mut futures = Vec::from_fn(1000, |ind| Future::spawn( proc() { partial_sum(ind) }));
let mut futures = Vec::from_fn(200, |ind| Future::spawn( proc() { partial_sum(ind) }));
let mut final_res = 0f64;
for ft in futures.mut_iter() {
Expand Down

0 comments on commit 7ce2ea0

Please sign in to comment.