auto merge of #7856 : brson/rust/no-thread-per-core, r=pcwalton
This doesn't make sense under the new scheduler.
This commit is contained in:
commit
b70c045f38
5 changed files with 1 additions and 28 deletions
|
@ -110,8 +110,6 @@ pub enum SchedMode {
|
||||||
/// All tasks run in the same OS thread
|
/// All tasks run in the same OS thread
|
||||||
SingleThreaded,
|
SingleThreaded,
|
||||||
/// Tasks are distributed among available CPUs
|
/// Tasks are distributed among available CPUs
|
||||||
ThreadPerCore,
|
|
||||||
/// Each task runs in its own OS thread
|
|
||||||
ThreadPerTask,
|
ThreadPerTask,
|
||||||
/// Tasks are distributed among a fixed number of OS threads
|
/// Tasks are distributed among a fixed number of OS threads
|
||||||
ManualThreads(uint),
|
ManualThreads(uint),
|
||||||
|
@ -1147,22 +1145,6 @@ fn test_child_doesnt_ref_parent() {
|
||||||
task::spawn(child_no(0));
|
task::spawn(child_no(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_sched_thread_per_core() {
|
|
||||||
let (port, chan) = comm::stream();
|
|
||||||
|
|
||||||
do spawn_sched(ThreadPerCore) || {
|
|
||||||
unsafe {
|
|
||||||
let cores = rt::rust_num_threads();
|
|
||||||
let reported_threads = rt::rust_sched_threads();
|
|
||||||
assert_eq!(cores as uint, reported_threads as uint);
|
|
||||||
chan.send(());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
port.recv();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_spawn_thread_on_demand() {
|
fn test_spawn_thread_on_demand() {
|
||||||
let (port, chan) = comm::stream();
|
let (port, chan) = comm::stream();
|
||||||
|
|
|
@ -38,7 +38,6 @@ pub extern {
|
||||||
fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id;
|
fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id;
|
||||||
fn rust_sched_threads() -> libc::size_t;
|
fn rust_sched_threads() -> libc::size_t;
|
||||||
fn rust_sched_current_nonlazy_threads() -> libc::size_t;
|
fn rust_sched_current_nonlazy_threads() -> libc::size_t;
|
||||||
fn rust_num_threads() -> libc::uintptr_t;
|
|
||||||
|
|
||||||
fn get_task_id() -> task_id;
|
fn get_task_id() -> task_id;
|
||||||
#[rust_stack]
|
#[rust_stack]
|
||||||
|
|
|
@ -85,7 +85,7 @@ use task::local_data_priv::{local_get, local_set, OldHandle};
|
||||||
use task::rt::rust_task;
|
use task::rt::rust_task;
|
||||||
use task::rt;
|
use task::rt;
|
||||||
use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded};
|
use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded};
|
||||||
use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask};
|
use task::{Success, TaskOpts, TaskResult, ThreadPerTask};
|
||||||
use task::{ExistingScheduler, SchedulerHandle};
|
use task::{ExistingScheduler, SchedulerHandle};
|
||||||
use task::unkillable;
|
use task::unkillable;
|
||||||
use uint;
|
use uint;
|
||||||
|
@ -752,7 +752,6 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {
|
||||||
| ExistingScheduler(*)
|
| ExistingScheduler(*)
|
||||||
| PlatformThread => 0u, /* Won't be used */
|
| PlatformThread => 0u, /* Won't be used */
|
||||||
SingleThreaded => 1u,
|
SingleThreaded => 1u,
|
||||||
ThreadPerCore => unsafe { rt::rust_num_threads() },
|
|
||||||
ThreadPerTask => {
|
ThreadPerTask => {
|
||||||
fail!("ThreadPerTask scheduling mode unimplemented")
|
fail!("ThreadPerTask scheduling mode unimplemented")
|
||||||
}
|
}
|
||||||
|
|
|
@ -476,12 +476,6 @@ rust_get_sched_id() {
|
||||||
return task->sched->get_id();
|
return task->sched->get_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CDECL uintptr_t
|
|
||||||
rust_num_threads() {
|
|
||||||
rust_task *task = rust_get_current_task();
|
|
||||||
return task->kernel->env->num_sched_threads;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" CDECL int
|
extern "C" CDECL int
|
||||||
rust_get_argc() {
|
rust_get_argc() {
|
||||||
rust_task *task = rust_get_current_task();
|
rust_task *task = rust_get_current_task();
|
||||||
|
|
|
@ -28,7 +28,6 @@ rust_get_argc
|
||||||
rust_get_argv
|
rust_get_argv
|
||||||
rust_new_sched
|
rust_new_sched
|
||||||
rust_new_task_in_sched
|
rust_new_task_in_sched
|
||||||
rust_num_threads
|
|
||||||
rust_path_is_dir
|
rust_path_is_dir
|
||||||
rust_path_exists
|
rust_path_exists
|
||||||
rust_get_stdin
|
rust_get_stdin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue