rt: Remove task pinning. Does nothing
This commit is contained in:
parent
18de0f2aeb
commit
57cad61353
@ -37,8 +37,6 @@ export yield;
|
||||
export task_notification;
|
||||
export join;
|
||||
export unsupervise;
|
||||
export pin;
|
||||
export unpin;
|
||||
export task_result;
|
||||
export tr_success;
|
||||
export tr_failure;
|
||||
@ -64,9 +62,6 @@ type rust_closure = {
|
||||
#[link_name = "rustrt"]
|
||||
#[abi = "cdecl"]
|
||||
native mod rustrt {
|
||||
// these can run on the C stack:
|
||||
fn pin_task();
|
||||
fn unpin_task();
|
||||
fn get_task_id() -> task_id;
|
||||
fn rust_get_task() -> *rust_task;
|
||||
|
||||
@ -310,20 +305,6 @@ An unsupervised task will not propagate its failure up the task tree
|
||||
*/
|
||||
fn unsupervise() { ret sys::unsupervise(); }
|
||||
|
||||
/*
|
||||
Function: pin
|
||||
|
||||
Pins the current task and future child tasks to a single scheduler thread
|
||||
*/
|
||||
fn pin() { rustrt::pin_task(); }
|
||||
|
||||
/*
|
||||
Function: unpin
|
||||
|
||||
Unpin the current task and future child tasks
|
||||
*/
|
||||
fn unpin() { rustrt::unpin_task(); }
|
||||
|
||||
/*
|
||||
Function: currently_unwinding()
|
||||
|
||||
|
@ -380,18 +380,6 @@ nano_time(uint64_t *ns) {
|
||||
*ns = t.time_ns();
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
pin_task() {
|
||||
rust_task *task = rust_scheduler::get_task();
|
||||
task->pin();
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
unpin_task() {
|
||||
rust_task *task = rust_scheduler::get_task();
|
||||
task->unpin();
|
||||
}
|
||||
|
||||
extern "C" CDECL rust_task_id
|
||||
get_task_id() {
|
||||
rust_task *task = rust_scheduler::get_task();
|
||||
|
@ -331,9 +331,6 @@ rust_scheduler::create_task(rust_task *spawner, const char *name,
|
||||
rust_task (this, &newborn_tasks, spawner, name, init_stack_sz);
|
||||
DLOG(this, task, "created task: " PTR ", spawner: %s, name: %s",
|
||||
task, spawner ? spawner->name : "null", name);
|
||||
if(spawner) {
|
||||
task->pin(spawner->pinned_on);
|
||||
}
|
||||
|
||||
{
|
||||
scoped_lock with(lock);
|
||||
|
@ -245,7 +245,6 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state,
|
||||
next_port_id(0),
|
||||
rendezvous_ptr(0),
|
||||
running_on(-1),
|
||||
pinned_on(-1),
|
||||
local_region(&sched->srv->local_region),
|
||||
boxed(&local_region),
|
||||
unwinding(false),
|
||||
@ -628,8 +627,7 @@ rust_task::backtrace() {
|
||||
bool rust_task::can_schedule(int id)
|
||||
{
|
||||
return
|
||||
running_on == -1 &&
|
||||
(pinned_on == -1 || pinned_on == id);
|
||||
running_on == -1;
|
||||
}
|
||||
|
||||
void *
|
||||
@ -637,20 +635,6 @@ rust_task::calloc(size_t size, const char *tag) {
|
||||
return local_region.calloc(size, tag);
|
||||
}
|
||||
|
||||
void rust_task::pin() {
|
||||
I(this->sched, running_on != -1);
|
||||
pinned_on = running_on;
|
||||
}
|
||||
|
||||
void rust_task::pin(int id) {
|
||||
I(this->sched, running_on == -1);
|
||||
pinned_on = id;
|
||||
}
|
||||
|
||||
void rust_task::unpin() {
|
||||
pinned_on = -1;
|
||||
}
|
||||
|
||||
rust_port_id rust_task::register_port(rust_port *port) {
|
||||
I(sched, !lock.lock_held_by_current_thread());
|
||||
scoped_lock with(lock);
|
||||
|
@ -101,7 +101,6 @@ rust_task : public kernel_owned<rust_task>, rust_cond
|
||||
// This flag indicates that a worker is either currently running the task
|
||||
// or is about to run this task.
|
||||
int running_on;
|
||||
int pinned_on;
|
||||
|
||||
memory_region local_region;
|
||||
boxed_region boxed;
|
||||
@ -180,10 +179,6 @@ rust_task : public kernel_owned<rust_task>, rust_cond
|
||||
|
||||
void *calloc(size_t size, const char *tag);
|
||||
|
||||
void pin();
|
||||
void pin(int id);
|
||||
void unpin();
|
||||
|
||||
rust_port_id register_port(rust_port *port);
|
||||
void release_port(rust_port_id id);
|
||||
rust_port *get_port_by_id(rust_port_id id);
|
||||
|
@ -20,9 +20,7 @@ leak
|
||||
nano_time
|
||||
new_port
|
||||
new_task
|
||||
pin_task
|
||||
port_recv
|
||||
unpin_task
|
||||
rand_free
|
||||
rand_new
|
||||
rand_next
|
||||
|
@ -8,14 +8,14 @@
|
||||
use std;
|
||||
|
||||
native mod rustrt {
|
||||
fn pin_task();
|
||||
fn do_gc();
|
||||
}
|
||||
|
||||
fn getbig_call_c_and_fail(i: int) {
|
||||
if i != 0 {
|
||||
getbig_call_c_and_fail(i - 1);
|
||||
} else {
|
||||
rustrt::pin_task();
|
||||
rustrt::do_gc();
|
||||
fail;
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ Can we bind native things?
|
||||
|
||||
#[abi = "cdecl"]
|
||||
native mod rustrt {
|
||||
fn pin_task();
|
||||
fn do_gc();
|
||||
}
|
||||
|
||||
fn main() { bind rustrt::pin_task(); }
|
||||
fn main() { bind rustrt::do_gc(); }
|
||||
|
@ -13,8 +13,6 @@ native mod rustrt {
|
||||
fn rust_getcwd() -> str;
|
||||
fn refcount(box: @int);
|
||||
fn do_gc();
|
||||
fn pin_task();
|
||||
fn unpin_task();
|
||||
fn get_task_id();
|
||||
fn sched_threads();
|
||||
fn rust_get_task();
|
||||
@ -25,8 +23,6 @@ fn calllink02() { rustrt::last_os_error(); }
|
||||
fn calllink03() { rustrt::rust_getcwd(); }
|
||||
fn calllink04() { rustrt::refcount(@0); }
|
||||
fn calllink05() { rustrt::do_gc(); }
|
||||
fn calllink06() { rustrt::pin_task(); }
|
||||
fn calllink07() { rustrt::unpin_task(); }
|
||||
fn calllink08() { rustrt::get_task_id(); }
|
||||
fn calllink09() { rustrt::sched_threads(); }
|
||||
fn calllink10() { rustrt::rust_get_task(); }
|
||||
@ -60,8 +56,6 @@ fn main() {
|
||||
calllink03,
|
||||
calllink04,
|
||||
calllink05,
|
||||
calllink06,
|
||||
calllink07,
|
||||
calllink08,
|
||||
calllink09,
|
||||
calllink10
|
||||
|
@ -4,16 +4,16 @@
|
||||
#[abi = "cdecl"]
|
||||
#[link_name = "rustrt"]
|
||||
native mod rustrt1 {
|
||||
fn pin_task();
|
||||
fn do_gc();
|
||||
}
|
||||
|
||||
#[abi = "cdecl"]
|
||||
#[link_name = "rustrt"]
|
||||
native mod rustrt2 {
|
||||
fn pin_task();
|
||||
fn do_gc();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
rustrt1::pin_task();
|
||||
rustrt2::pin_task();
|
||||
rustrt1::do_gc();
|
||||
rustrt2::do_gc();
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
/**
|
||||
Exercises task pinning and unpinning. Doesn't really ensure it
|
||||
works, just makes sure it runs.
|
||||
*/
|
||||
|
||||
use std;
|
||||
|
||||
import task;
|
||||
|
||||
fn main() { task::pin(); task::unpin(); }
|
Loading…
x
Reference in New Issue
Block a user