about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
AgeCommit message (Collapse)AuthorLines
2012-03-18rt: Remove lock_held_by_current_threadBrian Anderson-4/+0
2012-03-15rt: Remove the kernel task tableBrian Anderson-45/+5
2012-03-15rt: Look up ports through a single port tableBrian Anderson-0/+41
Instead of a two-level lookup, just use one big table
2012-03-01rt: Remove rust_kernel::live_tasks. UnusedBrian Anderson-3/+2
2012-02-27rt: Change the way the kernel exits to avoid pthread leaksBrian Anderson-17/+27
This makes the kernel join every scheduler thread before exiting in order to ensure that all threads are completely terminated before the process exits. On my machine, for 32-bit targets, this was causing regular valgrind errors.
2012-02-09rt: Make rust_task::ref_count privateBrian Anderson-0/+1
2012-02-09rt: Remove rust_task_user structBrian Anderson-4/+4
2012-02-09fix build on freebsdJyun-Yan You-0/+5
2012-02-08rt: Export a scheduler APIBrian Anderson-2/+3
2012-02-08rt: Hold schedulers in a mapBrian Anderson-7/+52
2012-02-08rt: Change the lifecycle of tasks and schedulers for various reasonsBrian Anderson-5/+0
This is in preparation for giving schedulers their own life cycle separate from the kernel. Tasks must be deleted before their scheduler thread, so we can't let the scheduler exit before all its tasks have been cleaned up. In this scheme, the scheduler will unregister tasks with the kernel when they are reaped, then drop their ref on the task (there may still be others). When the task ref count hits zero, the task will request to be unregistered from the scheduler, which is responsible for deleting the task. Instead of having the kernel tell the scheduler to exit, let the scheduler decide when to exit. For now it will exit when all of its tasks are unregistered.
2012-02-08rt: Start schedulers immediately upon creationBrian Anderson-8/+6
2012-02-08rt: Refactor the rust_kernel interface a bitBrian Anderson-18/+26
2012-02-08rt: Introduce scheduler idsBrian Anderson-1/+1
2012-02-08rt: Delete schedulers immediately upon releaseBrian Anderson-4/+1
This will be needed once we support dynamically changing schedulers.
2012-02-08rt: Change the scheme used for terminating the kernelBrian Anderson-5/+25
Instead of joining on the scheduler threads, instead keep a count of active schedulers. When there are no more schedulers raise a signal for the main thread to continue. This will be required once schedulers can be added and removed from the running kernel.
2012-02-04rt: Expand rust_kernel::live_tasks to a uintptr_tBrian Anderson-2/+2
2012-02-04rt: Stop using atomic ops on rust_kernel::live_tasksBrian Anderson-2/+4
These ops are all done within spitting distance of a suitable lock, so just protect it with the lock.
2012-02-03rt: Add sanity checks when we hit the max task/port idBrian Anderson-0/+1
2012-02-03rt: Clean up the way the kernel tracks tasksBrian Anderson-17/+28
2012-02-03rt: Do all task creation through a schedulerBrian Anderson-11/+5
2012-02-03rt: Extract rust_scheduler from rust_task_threadBrian Anderson-86/+16
2012-02-03rt: Rename rust_scheduler to rust_task_threadBrian Anderson-13/+13
2012-02-02rt: Only wake up all schedulers when no tasks are leftBrian Anderson-4/+2
At the moment there's not really any reason to be raising this signal, since they schedulers wake up periodically anyway, but once we remove the timer this will be how the schedulers know to exit.
2012-02-02rt: Do all signalling while holding a lockBrian Anderson-1/+3
This will matter once the scheduler is changed to not wake up on a timer
2012-02-01rt: Remove calls to signal the kernel lockBrian Anderson-3/+0
Nobody ever waits for it
2012-01-29rt: Make the initial segment of the main task's stack 1MBBrian Anderson-2/+8
This is a trick to fool microbenchmarks. Closes #1681
2012-01-12libcore: Add sys::set_exit_statusBrian Anderson-1/+11
Sets the process exit code
2012-01-06fix how we walk functions to match new closure fmtNiko Matsakis-1/+1
2011-12-20rt: Lock before using the random number generatorBrian Anderson-5/+3
Seeing crashes here trying to stress test concurrent tasks
2011-09-20rt: Rename rand() to isaac_rand() since the former prevents lots of standard ↵Patrick Walton-1/+1
headers from being included
2011-09-11Use a unique exit status when the runtime fails normallyBrian Anderson-1/+1
Check for it in run-fail tests
2011-08-24Return an error code after fail under win32Brian Anderson-1/+1
2011-08-17Making more of the rust_task structure directly accessible from Rust.Eric Holk-3/+3
2011-08-15Abort abruptly on failure on windowsBrian Anderson-0/+6
Trying to shutdown cleanly results in wierd failures
2011-08-15Reducing the chances for race conditions in join.Eric Holk-1/+11
2011-08-15Properly ref counting to fix valgrind issues on linux.Eric Holk-0/+1
2011-08-10rt: Shutdown gracefully on failureBrian Anderson-0/+8
When the kernel fails, kill all tasks and wait for the schedulers to stop instead of just exiting. I'm sure there are tons of lurking issues here but this is enough to fail without leaking (at least in the absence of cleanups).
2011-08-08Introduced task handles.unknown-2/+24
This is the new way to refer to tasks in rust-land. Currently all they do is serve as a key to look up the old rust_task structure. Ideally they won't be ref counted, but baby steps.
2011-07-29Minimize scheduler locking on task creationBrian Anderson-1/+0
This takes my CPU utilization on task-perf-spawnalot from 35% to 55%
2011-07-29Lock the new task's scheduler when creating a taskBrian Anderson-1/+3
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-29Removing proxies and message queues.Eric Holk-136/+3
2011-07-28Do all runtime calls to getenv at initializationBrian Anderson-1/+4
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-28Updating to work on Windows.Eric Holk-2/+4
2011-07-28Resurrecting some of the logging in rust_chan.cppEric Holk-18/+14
2011-07-28Removed outdated comment.Eric Holk-1/+0
2011-07-28Made task threads wait instead of sleep, so they can be woken up. This ↵Eric Holk-5/+11
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-28Per-thread scheduling. Closes #682.Eric Holk-45/+40
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-28Made root_task no longer special.Eric Holk-0/+5
2011-07-21Lots of work on memory tracking and channels.Eric Holk-15/+13
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.