Skip to content

Commit b70c045

Browse files
committed
auto merge of #7856 : brson/rust/no-thread-per-core, r=pcwalton
This doesn't make sense under the new scheduler.
2 parents f28e581 + 1dbcc8b commit b70c045

File tree

5 files changed

+1
-28
lines changed

5 files changed

+1
-28
lines changed

src/libstd/task/mod.rs

-18
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ pub enum SchedMode {
110110
/// All tasks run in the same OS thread
111111
SingleThreaded,
112112
/// Tasks are distributed among available CPUs
113-
ThreadPerCore,
114-
/// Each task runs in its own OS thread
115113
ThreadPerTask,
116114
/// Tasks are distributed among a fixed number of OS threads
117115
ManualThreads(uint),
@@ -1147,22 +1145,6 @@ fn test_child_doesnt_ref_parent() {
11471145
task::spawn(child_no(0));
11481146
}
11491147

1150-
#[test]
1151-
fn test_sched_thread_per_core() {
1152-
let (port, chan) = comm::stream();
1153-
1154-
do spawn_sched(ThreadPerCore) || {
1155-
unsafe {
1156-
let cores = rt::rust_num_threads();
1157-
let reported_threads = rt::rust_sched_threads();
1158-
assert_eq!(cores as uint, reported_threads as uint);
1159-
chan.send(());
1160-
}
1161-
}
1162-
1163-
port.recv();
1164-
}
1165-
11661148
#[test]
11671149
fn test_spawn_thread_on_demand() {
11681150
let (port, chan) = comm::stream();

src/libstd/task/rt.rs

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pub extern {
3838
fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id;
3939
fn rust_sched_threads() -> libc::size_t;
4040
fn rust_sched_current_nonlazy_threads() -> libc::size_t;
41-
fn rust_num_threads() -> libc::uintptr_t;
4241

4342
fn get_task_id() -> task_id;
4443
#[rust_stack]

src/libstd/task/spawn.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ use task::local_data_priv::{local_get, local_set, OldHandle};
8585
use task::rt::rust_task;
8686
use task::rt;
8787
use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded};
88-
use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask};
88+
use task::{Success, TaskOpts, TaskResult, ThreadPerTask};
8989
use task::{ExistingScheduler, SchedulerHandle};
9090
use task::unkillable;
9191
use uint;
@@ -752,7 +752,6 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {
752752
| ExistingScheduler(*)
753753
| PlatformThread => 0u, /* Won't be used */
754754
SingleThreaded => 1u,
755-
ThreadPerCore => unsafe { rt::rust_num_threads() },
756755
ThreadPerTask => {
757756
fail!("ThreadPerTask scheduling mode unimplemented")
758757
}

src/rt/rust_builtin.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,6 @@ rust_get_sched_id() {
476476
return task->sched->get_id();
477477
}
478478

479-
extern "C" CDECL uintptr_t
480-
rust_num_threads() {
481-
rust_task *task = rust_get_current_task();
482-
return task->kernel->env->num_sched_threads;
483-
}
484-
485479
extern "C" CDECL int
486480
rust_get_argc() {
487481
rust_task *task = rust_get_current_task();

src/rt/rustrt.def.in

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ rust_get_argc
2828
rust_get_argv
2929
rust_new_sched
3030
rust_new_task_in_sched
31-
rust_num_threads
3231
rust_path_is_dir
3332
rust_path_exists
3433
rust_get_stdin

0 commit comments

Comments
 (0)