about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-09-16 00:45:29 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-09-16 00:47:49 -0400
commit7ce2ea0d148a3a7c9ad0f156c8e08a2e6482265f (patch)
tree4f775ea7a2ecff4247a39f14a5a427882bf4f6b4
parent63eaba24d6a7f93061d63337ea1f7083ca892787 (diff)
downloadrust-7ce2ea0d148a3a7c9ad0f156c8e08a2e6482265f.tar.gz
rust-7ce2ea0d148a3a7c9ad0f156c8e08a2e6482265f.zip
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
-rw-r--r--src/doc/guide-tasks.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc/guide-tasks.md b/src/doc/guide-tasks.md
index 687f2a3a833..a02dd5a1c7d 100644
--- a/src/doc/guide-tasks.md
+++ b/src/doc/guide-tasks.md
@@ -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()  {