about summary refs log tree commit diff
path: root/src/rt
AgeCommit message (Collapse)AuthorLines
2012-04-03std: add localtime/gmtime support.Erick Tryzelaar-0/+127
2012-04-03std: fix a typo.Erick Tryzelaar-1/+1
2012-04-03std: change timeval to ns resolution timespecErick Tryzelaar-4/+11
This lets us use the more precise clock_gettime on posix machines.
2012-04-03std: change time::timeval to be {sec: i64, usec: i32}.Erick Tryzelaar-2/+2
It's possible to have negative times if expressing time before 1970, so we should use signed types. Other platforms can return times at a higher resolution, so we should use 64 bits.
2012-04-03Merge remote-tracking branch 'brson/mainthread'Brian Anderson-28/+167
Conflicts: src/rt/rust_kernel.cpp src/rt/rust_scheduler.cpp src/rt/rust_scheduler.h
2012-04-03rt: Fix bugs in the osmain schedulerBrian Anderson-6/+13
2012-04-03rt: Fix bugs in the osmain schedulerBrian Anderson-1/+20
2012-04-03rt: Include the correct header for alloca on windowsBrian Anderson-4/+4
2012-04-03rt: alloca is spelled differently on win32Brian Anderson-0/+4
2012-04-03rt: Fix the 0 bytes lost issueBrian Anderson-0/+16
This is a workaround for #1815. libev uses realloc(0) to free the loop, which valgrind doesn't like. We have suppressions to make valgrind ignore them. Valgrind also has a sanity check when collecting allocation backtraces that the stack pointer must be at least 512 bytes into the stack (at least 512 bytes of frames must have come before). When this is not the case it doesn't collect the backtrace. Unfortunately, with our spaghetti stacks that valgrind check triggers sometimes and we don't get the backtrace for the realloc(0), it fails to be suppressed, and it gets reported as 0 bytes lost from a malloc with no backtrace. This fixes the issue by alloca'ing 512 bytes before calling uv_loop_delete
2012-04-03rt: Futz with headers to satisfy FreeBSDBrian Anderson-3/+2
2012-04-03fix 'I don't know how C works'Jon Morton-1/+5
2012-04-03actually remove memory.h; include cleanupsJon Morton-21/+4
2012-04-03Refactor includes structure, getting rid of rust_internal.hJon Morton-412/+311
Many changes to code structure are included: - removed TIME_SLICE_IN_MS - removed sychronized_indexed_list - removed region_owned - kernel_owned move to kernel.h, task_owned moved to task.h - global configs moved to rust_globals.h - changed #pragma once to standard guard in rust_upcall.h - got rid of memory.h
2012-04-03core: Add a scheduler mode, osmain, to spawn onto the main schedulerBrian Anderson-0/+9
2012-04-02Construct new strings through upcalls.Graydon Hoare-0/+22
2012-04-02rt: Run a single-threaded scheduler on the main threadBrian Anderson-21/+57
2012-04-02rt: Add an assert to rust_get_current_taskBrian Anderson-0/+1
2012-04-02remove unneeded assert, move get_task_tls to sched_loopJon Morton-27/+27
2012-04-02Add global rust_get_current_taskJon Morton-101/+88
Previously two methods existed: rust_sched_loop::get_task and rust_task::get_task_from_tcb. Merge both of them into one, trying the faster one (tcb) first, and if that fails, the slower one from the tls.
2012-04-02rt: cleanup passing around of rust_envJon Morton-11/+7
2012-04-01rt: rust_env is a structBrian Anderson-1/+1
2012-04-01rt: Assert things that are trueBrian Anderson-1/+1
2012-04-01rt: Convert an old warning to an assertBrian Anderson-5/+1
2012-04-01remove rust_srvJon Morton-173/+44
2012-04-01replace assertion macros with plain assertsJon Morton-124/+100
2012-04-01rt: Introduce rust_manual_sched_launcher_factory. Again, so sorryBrian Anderson-0/+18
2012-04-01rt: Introduce rust_sched_launcher_factory. Sorry, I need oneBrian Anderson-10/+31
2012-04-01rt: Allow some schedulers to stay alive even without tasks to executeBrian Anderson-8/+26
2012-04-01rt: Introduce rust_manual_sched_launcherBrian Anderson-1/+13
2012-04-01rt: rust_sched_launcher needs a virtual destructorBrian Anderson-0/+1
2012-04-01rt: rust_sched_launcher does not need a join() methodBrian Anderson-1/+0
2012-04-01Merge remote-tracking branch 'brson/mainthread'Brian Anderson-259/+545
Conflicts: src/rt/rust_sched_loop.cpp src/rt/rust_shape.cpp src/rt/rust_task.cpp
2012-03-31rt: Extract rust_thread_sched_launcher from rust_sched_launcherBrian Anderson-9/+26
2012-03-31rt: Fix whitespaceBrian Anderson-99/+109
2012-03-31rt: Make rust_sched_launcher hide it's thread implementationBrian Anderson-10/+5
2012-03-31rt: Add some more locking asserts to rust_sched_loopBrian Anderson-0/+2
2012-03-31Revert "rt: Remove lock_held_by_current_thread"Brian Anderson-0/+83
Adds back the ability to make assertions about locks, but only under the --enable-debug configuration This reverts commit b247de64583e2ab527088813ba9192824554e801. Conflicts: src/rt/rust_sched_loop.cpp
2012-03-31rt: Extract start_main_loop from rust_sched_loop to rust_sched_driverBrian Anderson-32/+107
2012-03-31rt: Introduce rust_sched_reaperBrian Anderson-7/+56
This just moves the responsibility for joining with scheduler threads off to a worker thread. This will be needed when we allow tasks to be scheduled on the main thread.
2012-03-31rt: Refactor the scheduler loop so that it can be driven from withoutBrian Anderson-20/+53
2012-03-31rt: Rename rust_task_thread to rust_sched_loopBrian Anderson-189/+189
This class no longer represents a thread; it just schedules tasks.
2012-03-31rt: Extract rust_sched_launcher from rust_task_threadBrian Anderson-37/+70
rust_sched_launcher is actually responsible for setting up the thread and starting the loop. There will be other implementations that do not actually set up a new thread, in order to support scheduling tasks on the main OS thread.
2012-03-31initialize cur_thread, first task on thread 0Jon Morton-2/+3
2012-03-31Choose task thread in rust_scheduler by round robinJon Morton-14/+15
Remove the random context from rust_scheduler and use a simple round robin system to choose which thread a new task gets put on. Also, some incorrect tab indents around scoped blocks were fixed.
2012-03-29rt: Track backtraces of all allocations with RUSTRT_TRACK_ALLOCATIONS=3Brian Anderson-0/+22
2012-03-29rt: Make the CC sweep use the box annihilatorBrian Anderson-190/+7
2012-03-29rt: Make the box annihilator walk and delete contentsBrian Anderson-1/+194
2012-03-29rt: For now, only run the box annihilator after task failureBrian Anderson-6/+14
2012-03-29rustc: Only invoke when there are cleanupsBrian Anderson-1/+0