Brian Anderson
d552a0b959
Minimize scheduler locking on task creation
...
This takes my CPU utilization on task-perf-spawnalot from 35% to 55%
2011-07-29 23:02:51 -07:00
Brian Anderson
6657e729de
Lock the new task's scheduler when creating a task
...
Previously we were locking the spawning task's scheduler. I couldn't
see that that was protecting anything. The newborn_task list in the new task's
scheduler though was unprotected from concurrent access. So now we're locking
the new task's scheduler.
2011-07-29 22:43:11 -07:00
Eric Holk
d1dbb99984
Removing proxies and message queues.
2011-07-29 18:54:59 -07:00
Brian Anderson
4ef1ec580a
Do all runtime calls to getenv at initialization
...
getenv is not threadsafe and (maybe as a result) it's randomly crashing with
CFLAGS=-g and RUST_THREADS=32. Calls from rust code are still on their
own.
2011-07-28 12:23:01 -07:00
Eric Holk
3d7016ae95
Updating to work on Windows.
2011-07-28 10:47:29 -07:00
Eric Holk
b85dee8d5b
Resurrecting some of the logging in rust_chan.cpp
2011-07-28 10:47:28 -07:00
Eric Holk
9ea8476faa
Removed outdated comment.
2011-07-28 10:47:28 -07:00
Eric Holk
5302cde188
Made task threads wait instead of sleep, so they can be woken up. This appears to give us much better parallel performance.
...
Also, commented out one more unsafe log and updated rust_kernel.cpp to compile under g++
2011-07-28 10:47:28 -07:00
Eric Holk
62bc6b5113
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.
2011-07-28 10:47:28 -07:00
Eric Holk
b51f5c395c
Made root_task no longer special.
2011-07-28 10:47:28 -07:00
Eric Holk
3ae4dcd41e
Lots of work on memory tracking and channels.
...
We're trying to get closer to doing correct move semantics for channel
operations. This involves a lot of cleanup (such as removing the
unused sched parameter from rust_vec constructor) and making
circular_buffer kernel_owned.
Added tagging for memory allocations. This means we give a string tag
to everything we allocate. If we leak something and TRACK_ALLOCATIONS
is enabled, then it's much easier now to tell exactly what is leaking.
2011-07-21 11:51:22 -07:00
Graydon Hoare
39151f2ad8
Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.
2011-07-13 15:44:09 -07:00
Graydon Hoare
49116adbe9
Fix compile-command lines in rt.
2011-07-13 13:51:20 -07:00
Rob Arnold
2e2e1f7cb3
Add realloc method to rust_kernel
2011-07-06 20:37:27 -07:00
Patrick Walton
91eb63eaee
rt: Add a stack check to upcall_get_type_desc
2011-07-06 15:07:04 -07:00
Graydon Hoare
c796a8f24d
Re-enable tidy (it was broken) and fix various non-tidy things.
2011-06-29 15:14:55 -07:00
Eric Holk
657e5a2bd5
Renamed what's left of rust_dom to rust_scheduler
2011-06-28 16:12:33 -07:00
Eric Holk
02f6645fca
Moved win32_require to the kernel.
2011-06-28 16:12:33 -07:00
Eric Holk
f6f945fed5
Moved thread management to rust_kernel.
2011-06-28 16:12:33 -07:00
Eric Holk
c6d8324830
There is only one domain per kernel now.
2011-06-28 16:12:33 -07:00
Eric Holk
d1857d30fc
This is the mega-ucontext commit. It replaces the task switching mechanism with a new one inspired by ucontext. It works under Linux, OS X and Windows, and is Valgrind clean on Linux and OS X (provided the runtime is built with gcc).
...
This commit also moves yield and join to the standard library, as requested in #42 . Join is currently a no-op though.
2011-06-13 18:14:13 -07:00
Rafael Ávila de Espíndola
395940f7e3
Dead code elimination.
2011-05-24 19:07:30 -04:00
Marijn Haverbeke
880be6a940
Overhaul logging system in runtime
...
See https://github.com/graydon/rust/wiki/Logging-vision
The runtime logging categories are now treated in the same way as
modules in compiled code. Each domain now has a log_lvl that can be
used to restrict the logging from that domain (will be used to allow
logging to be restricted to a single domain).
Features dropped (can be brought back to life if there is interest):
- Logger indentation
- Multiple categories per log statement
- I possibly broke some of the color code -- it confuses me
2011-04-19 16:57:13 +02:00
Brian Anderson
b883ec4c9d
Avoid some gotchas with logging macros
...
I think this is sufficient to eliminate multiple evaluation and the
possibility of accidental miscompilation from the logging macros.
2011-04-07 22:53:16 -04:00
Marijn Haverbeke
9a7576fe2c
Move to macro-based logging checks in the C++ code
...
No functions should be called for log statements that turn out to be
inactive.
2011-04-07 15:15:30 -07:00
Graydon Hoare
d55bee4417
Further corrections to the logging layer in runtime.
2011-01-14 16:50:37 -08:00
Michael Bebenita
1bd331b7aa
Fixed deadlock caused by the message pump not being notified of new message sends.
2010-09-16 00:51:03 -07:00
Michael Bebenita
a493350eb5
Cleanup, refactoring, and some runtime tests.
2010-09-10 14:38:31 -07:00
Michael Bebenita
f985fded3e
Added lock_and_signal::signal_all(), and made the rust_kernel::join() use wait instead of yield.
2010-09-10 14:38:31 -07:00
Michael Bebenita
c877f31730
Fixed lost signal notifications.
2010-09-08 22:20:31 -07:00
Graydon Hoare
616b7afb72
Tidy up the sync dir, remove dead or mis-designed code in favour of OS primitives, switch rust_kernel to use a lock/signal pair and wait rather than spin.
2010-09-08 19:13:49 -07:00
Graydon Hoare
13d6f87431
XFAIL many.rs since it crashes on win32, and add a time-slice sleep to the kernel message loop to get tests to finish in a sane time.
2010-09-08 15:48:18 -07:00
Michael Bebenita
388f8ce520
Cleaned up locking in the kernel.
2010-09-08 15:17:09 -07:00
Michael Bebenita
7f6d8b95bd
Fixed race in the rust kernel.
2010-09-07 23:37:51 -07:00
Michael Bebenita
de611a3090
Lots of design changes around proxies and message passing. Made it so that domains can only talk to other domains via handles, and with the help of the rust_kernel.
2010-09-07 18:44:12 -07:00
Michael Bebenita
f8ff013e3c
Added a few utility classes, cleaned up the include order of .h files, and started to make the Rust kernel own domain message queues rather than the Rust domains themselves.
2010-09-07 18:41:07 -07:00