about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-07-20 00:37:42 -0700
committerbors <bors@rust-lang.org>2013-07-20 00:37:42 -0700
commit098709aa638bb29998b5e6f2700997b13c2c6712 (patch)
treed5649031ca9d2ce42d9164d835a6326d5c29a9a5 /src/libstd/rt
parent8d97c905ddecec2e2d0d72926bc4c9e739ccb6e3 (diff)
parent49b72bdd77916e27aaf95909516702c1450f11ac (diff)
downloadrust-098709aa638bb29998b5e6f2700997b13c2c6712.tar.gz
rust-098709aa638bb29998b5e6f2700997b13c2c6712.zip
auto merge of #7855 : brson/rust/rt-overcommit, r=pcwalton
Too much overcommit here exhausts the low fd limit on OS X.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/test.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs
index e5393c84a08..b568705245f 100644
--- a/src/libstd/rt/test.rs
+++ b/src/libstd/rt/test.rs
@@ -64,7 +64,6 @@ pub fn run_in_mt_newsched_task(f: ~fn()) {
     use os;
     use from_str::FromStr;
     use rt::sched::Shutdown;
-    use rt::util;
 
     let f_cell = Cell::new(f);
 
@@ -72,10 +71,10 @@ pub fn run_in_mt_newsched_task(f: ~fn()) {
         let nthreads = match os::getenv("RUST_RT_TEST_THREADS") {
             Some(nstr) => FromStr::from_str(nstr).get(),
             None => {
-                // Using more threads than cores in test code
-                // to force the OS to preempt them frequently.
-                // Assuming that this help stress test concurrent types.
-                util::num_cpus() * 2
+                // A reasonable number of threads for testing
+                // multithreading. NB: It's easy to exhaust OS X's
+                // low maximum fd limit by setting this too high (#7772)
+                4
             }
         };