Per-thread scheduling. Closes #682.
Tasks are spawned on a random thread. Currently they stay there, but we should add task migration and load balancing in the future. This should drammatically improve our task performance benchmarks.
This commit is contained in:
parent
b51f5c395c
commit
62bc6b5113
14 changed files with 239 additions and 185 deletions
41
src/test/run-pass/lib-task.rs
Normal file
41
src/test/run-pass/lib-task.rs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
|
||||
// xfail-stage0
|
||||
|
||||
use std;
|
||||
import std::task;
|
||||
|
||||
fn test_sleep() { task::sleep(1000000u); }
|
||||
|
||||
fn test_unsupervise() {
|
||||
fn f() {
|
||||
task::unsupervise();
|
||||
fail;
|
||||
}
|
||||
spawn f();
|
||||
}
|
||||
|
||||
fn test_join() {
|
||||
fn winner() {
|
||||
}
|
||||
|
||||
auto wintask = spawn winner();
|
||||
|
||||
assert task::join(wintask) == task::tr_success;
|
||||
|
||||
fn failer() {
|
||||
task::unsupervise();
|
||||
fail;
|
||||
}
|
||||
|
||||
auto failtask = spawn failer();
|
||||
|
||||
assert task::join(failtask) == task::tr_failure;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// FIXME: Why aren't we running this?
|
||||
//test_sleep();
|
||||
test_unsupervise();
|
||||
test_join();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue