From 62bc6b51136760b1d4f4b691aaa089bdb9bf0af5 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Sat, 23 Jul 2011 19:03:02 -0700 Subject: 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. --- src/rt/test/rust_test_runtime.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/rt/test/rust_test_runtime.cpp') diff --git a/src/rt/test/rust_test_runtime.cpp b/src/rt/test/rust_test_runtime.cpp index f9a99d9acb1..1e7c10944a7 100644 --- a/src/rt/test/rust_test_runtime.cpp +++ b/src/rt/test/rust_test_runtime.cpp @@ -11,17 +11,16 @@ rust_test_runtime::~rust_test_runtime() { void rust_domain_test::worker::run() { - rust_scheduler *handle = kernel->get_scheduler(); for (int i = 0; i < TASKS; i++) { - handle->create_task(NULL, "child"); + kernel->create_task(NULL, "child"); } - sync::sleep(rand(&handle->rctx) % 1000); + //sync::sleep(rand(&handle->rctx) % 1000); } bool rust_domain_test::run() { rust_srv srv; - rust_kernel kernel(&srv); + rust_kernel kernel(&srv, 1); array_list workers; for (int i = 0; i < DOMAINS; i++) { @@ -47,13 +46,13 @@ void rust_task_test::worker::run() { rust_task *root_task = kernel->create_task(NULL, "main"); root_task->start((uintptr_t)&task_entry, (uintptr_t)NULL); - root_task->sched->start_main_loop(0); + root_task->sched->start_main_loop(); } bool rust_task_test::run() { rust_srv srv; - rust_kernel kernel(&srv); + rust_kernel kernel(&srv, 1); array_list workers; for (int i = 0; i < DOMAINS; i++) { @@ -62,6 +61,6 @@ rust_task_test::run() { worker->start(); } - sync::sleep(rand(&kernel.sched->rctx) % 1000); + //sync::sleep(rand(&kernel.sched->rctx) % 1000); return true; } -- cgit 1.4.1-3-g733a5