Skip to content

Commit 7ce2ea0

Browse files
committed
stop spawning so many tasks in guide-tasks
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
1 parent 63eaba2 commit 7ce2ea0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/guide-tasks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn partial_sum(start: uint) -> f64 {
235235
}
236236
237237
fn main() {
238-
let mut futures = Vec::from_fn(1000, |ind| Future::spawn( proc() { partial_sum(ind) }));
238+
let mut futures = Vec::from_fn(200, |ind| Future::spawn( proc() { partial_sum(ind) }));
239239
240240
let mut final_res = 0f64;
241241
for ft in futures.mut_iter() {

0 commit comments

Comments
 (0)