Skip to content

Commit

Permalink
auto merge of #7855 : brson/rust/rt-overcommit, r=pcwalton
Browse files Browse the repository at this point in the history
Too much overcommit here exhausts the low fd limit on OS X.
  • Loading branch information
bors committed Jul 20, 2013
2 parents 8d97c90 + 49b72bd commit 098709a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/libstd/rt/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,17 @@ 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);

do run_in_bare_thread {
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
}
};

Expand Down

0 comments on commit 098709a

Please sign in to comment.