Jon Morton
bcb9269d84
rt: cleanup passing around of rust_env
2012-04-02 03:11:58 -05:00
Jon Morton
128a8b6ed5
remove rust_srv
2012-04-01 22:18:40 -05:00
Jon Morton
413994ea3e
replace assertion macros with plain asserts
2012-04-01 21:14:16 -05:00
Brian Anderson
e78396850d
Merge remote-tracking branch 'brson/mainthread'
...
Conflicts:
src/rt/rust_sched_loop.cpp
src/rt/rust_shape.cpp
src/rt/rust_task.cpp
2012-04-01 00:15:04 -07:00
Brian Anderson
21064637ed
rt: Fix whitespace
2012-03-31 23:12:06 -07:00
Brian Anderson
c8dc6fcb4c
Revert "rt: Remove lock_held_by_current_thread"
...
Adds back the ability to make assertions about locks, but only under the
--enable-debug configuration
This reverts commit b247de6458
.
Conflicts:
src/rt/rust_sched_loop.cpp
2012-03-31 19:51:29 -07:00
Brian Anderson
243790836a
rt: Rename rust_task_thread to rust_sched_loop
...
This class no longer represents a thread; it just schedules tasks.
2012-03-31 19:51:29 -07:00
Brian Anderson
5747fe7a2c
rt: For now, only run the box annihilator after task failure
2012-03-29 16:43:18 -07:00
Brian Anderson
7f9ed39040
rustc: Only invoke when there are cleanups
2012-03-29 16:43:18 -07:00
Brian Anderson
3a7a408386
rt: Free all outstanding boxes at task death
2012-03-29 16:43:18 -07:00
Graydon Hoare
2aaca455b9
Tidy up multiple declarations and STDC_FOO_MACROS guards in headers.
2012-03-28 14:26:51 -07:00
Brian Anderson
08f783ff10
rt: Add a task field to stk_seg and populate it
2012-03-21 19:10:32 -07:00
Brian Anderson
ba322b0a70
rt: Reset the stack limit after catching an exception
...
This wasn't causing problems but it looked wrong
2012-03-21 19:10:31 -07:00
Brian Anderson
b78af4f7c4
rt: Inline a bunch of stack switching code
2012-03-21 19:10:31 -07:00
Brian Anderson
d5968d9f38
rt: Swap the definition of stk_seg::next and prev
2012-03-21 19:10:31 -07:00
Brian Anderson
6115b13dfc
rt: Don't switch to the C stack on the upcall_new_stack fast path
2012-03-21 19:10:31 -07:00
Brian Anderson
8a145a601e
rt: Don't swatch stacks during upcall_del_stack
2012-03-21 19:10:31 -07:00
Brian Anderson
05466c6138
rt: Use an enum to represent the task state
2012-03-18 17:41:56 -07:00
Brian Anderson
b247de6458
rt: Remove lock_held_by_current_thread
2012-03-18 17:03:35 -07:00
Marijn Haverbeke
22bef74b55
Remove shared tydescs
...
All tydescs are static now, there's no need to worry about
marshalling them between threads anymore.
2012-03-16 15:38:42 +01:00
Marijn Haverbeke
76d07f4056
Remove dynastack support from runtime
...
Issue #1982
2012-03-16 00:44:06 +01:00
Marijn Haverbeke
146b61189a
Get rid of rust_crate_cache in the runtime
...
We are no longer generating dynamic tydescs or dicts.
Issue #1982
2012-03-16 00:44:06 +01:00
Brian Anderson
561511e628
core: Channels are just port ids
2012-03-15 11:10:53 -07:00
Brian Anderson
b278d675a2
rt: Look up ports through a single port table
...
Instead of a two-level lookup, just use one big table
2012-03-15 11:10:52 -07:00
Brian Anderson
4c4a2320eb
rt: Make rust_port_detach less contentious
...
It still utterly dominates some benchmarks with busy waiting, but at least it
doesn't create lock contention while doing so.
2012-03-05 19:39:56 -08:00
Brian Anderson
0a5603cb58
rt: Make linked failure less prone to deadlock
...
Still a mess.
2012-03-05 19:39:56 -08:00
Brian Anderson
cc276fe3c9
rt: Be more precise with VALGRIND_MAKE_MEM_UNDEFINED
2012-03-05 19:39:56 -08:00
Brian Anderson
c78da1e170
rt: Stop calling prepare_valgrind_stack when it's not needed
2012-03-05 19:39:56 -08:00
Brian Anderson
93fa933a19
rt: Move some locking from rust_port to rust_task
2012-03-05 19:39:56 -08:00
Brian Anderson
e3ccac8ed3
rt: Renome rust_task::lock to port_lock
2012-03-05 19:39:55 -08:00
Brian Anderson
fa566ad2fd
rt: Make the rust_task_thread lock private
2012-03-05 19:39:55 -08:00
Brian Anderson
2465a63a69
rt: Move transition from rust_task to rust_task_thread
2012-03-05 19:39:55 -08:00
Brian Anderson
237652299e
rt: Protect cond and cond_name with the state_lock
2012-03-05 19:39:55 -08:00
Brian Anderson
0432030c27
rt: Don't take the task lock on state transitions
2012-03-05 19:39:55 -08:00
Brian Anderson
b2a075e20d
rt: Protect rust_task::state with a lock
2012-03-05 19:39:55 -08:00
Brian Anderson
d7298a797b
rt: Protect rust_task::killed with a lock
2012-03-05 19:39:55 -08:00
Brian Anderson
ed7d25bb6d
rt: Checking port_table.is_empty() requires a lock
2012-03-02 17:10:14 -08:00
Brian Anderson
04d9cc18a5
rt: Protect rust_task::supervisor with a lock
2012-03-02 16:33:33 -08:00
Brian Anderson
14306756b4
rt: Always delete task stacks on the task thread
...
There's not a real race here, but it makes helgrind happy and is arguably
less prone to future errrors.
2012-03-02 15:21:59 -08:00
Brian Anderson
7e9aa6c3c2
rt: Don't zero new stacks
2012-02-27 16:13:51 -08:00
Niko Matsakis
5ee89f3f2a
add an option to the final cc so that it prints out/logs unreclaimed ptrs
2012-02-24 20:46:27 -08:00
Brian Anderson
155a67eae7
Revert "rt: Cut the red zone to 10K on mac"
...
This reverts commit cb7022cfc2
.
2012-02-24 12:26:06 -08:00
Brian Anderson
cb7022cfc2
rt: Cut the red zone to 10K on mac
2012-02-23 19:42:59 -08:00
Brian Anderson
7a6498668f
rt: Cut the red zone to 2K on linux
2012-02-23 00:23:22 -08:00
Brian Anderson
cd381333b9
rt: Cut the red zone to 4K on linux
2012-02-22 23:50:47 -08:00
Brian Anderson
b5c7997ef5
rt: Switch to the C stack in reset_stack_limit
2012-02-22 23:50:47 -08:00
Brian Anderson
c16bfbe0c3
rt: Stop logging on the Rust stack. Closes #1478
2012-02-22 22:30:21 -08:00
Brian Anderson
d5e7f0d113
rt: Don't kill tasks while they are in a callback from C
2012-02-14 11:24:09 -08:00
Brian Anderson
3af4b2c998
rt: Call register/deregister_valgrind_stack from the stack con/destructors
2012-02-10 12:58:35 -08:00
Brian Anderson
3406da49d9
rt: Extract prepare_valgrind_stack from register_valgrind_stack
2012-02-10 12:58:35 -08:00
Brian Anderson
c42492e6aa
rt: Rename config_valgrind_stack to register_valgrind_stack, etc
2012-02-10 12:58:35 -08:00
Brian Anderson
fc028c30a0
rt: Move the addition of the stack canary into create_stack
2012-02-10 12:58:35 -08:00
Brian Anderson
d493438c98
rt: Disable some expensive asserts
2012-02-09 22:58:40 -08:00
Brian Anderson
d90a9d3da0
rt: Inline everything on the C-stack-switching path
2012-02-09 22:15:15 -08:00
Brian Anderson
8ad9cf8087
rt: Add more stack-switching commentary
2012-02-09 19:00:16 -08:00
Brian Anderson
5d2442d89c
rt: Add upcall_call_shim_on_rust_stack
2012-02-09 19:00:16 -08:00
Brian Anderson
79b1563abb
rt: Use rust_task_thread's C-stack pool for native calls
2012-02-09 19:00:16 -08:00
Brian Anderson
8fe506bdca
rt: Move more setup code into create_stack
2012-02-09 19:00:16 -08:00
Brian Anderson
ea76d3f454
rt: Add rust_task::call_on_c_stack
2012-02-09 19:00:16 -08:00
Brian Anderson
1e2fe4ab8f
rt: Rename call_shim_on_c_stack to call_and_change_stacks
2012-02-09 19:00:15 -08:00
Brian Anderson
ae8ea4a78b
rt: Add constructors and destructors for stacks
2012-02-09 19:00:15 -08:00
Brian Anderson
b98df86c09
rt: Move some stack manipulation functions into rust_task
2012-02-09 19:00:15 -08:00
Brian Anderson
4bd8f8d936
rt: Rename new_stack to next_stack, del_stack to prev_stack
2012-02-09 19:00:15 -08:00
Brian Anderson
889a783494
rt: Remove rust_task::rust_sp
2012-02-09 19:00:15 -08:00
Brian Anderson
d39ea47746
rt: Remove rust_task_user struct
2012-02-09 19:00:15 -08:00
Brian Anderson
d756b01619
rt: Add a function for configuring task notification
2012-02-09 19:00:15 -08:00
Brian Anderson
e0d5b92b84
rt: Begin moving stack-building functions to rust_stack.cpp
2012-02-09 19:00:15 -08:00
Brian Anderson
028af5cb6c
rt: Change the lifecycle of tasks and schedulers for various reasons
...
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-08 15:42:51 -08:00
Brian Anderson
c7777f4fd9
rt: Add sanity checks when we hit the max task/port id
2012-02-03 23:48:12 -08:00
Brian Anderson
12fa90888e
rt: Clean up the way the kernel tracks tasks
2012-02-03 23:48:12 -08:00
Brian Anderson
3d0e7a7af3
rt: Add a field to rust_task to hold its scheduler
2012-02-03 23:48:12 -08:00
Brian Anderson
f94339cc1c
rt: Rename rust_scheduler to rust_task_thread
2012-02-03 23:48:12 -08:00
Marijn Haverbeke
c1b075d042
Remove experimental GC code
...
It's been sitting unused long enough to have bitrotted completely.
2012-02-03 11:34:12 +01:00
Brian Anderson
5c3c8d454d
rt: Do all signalling while holding a lock
...
This will matter once the scheduler is changed to not wake up on a timer
2012-02-02 18:10:24 -08:00
Brian Anderson
3978fbff8b
rt: Remove rust_task::can_schedule. Does nothing
2012-02-02 18:10:24 -08:00
Brian Anderson
ed3a5ad5ad
rt: Remove running_on flag. Does nothing
2012-02-02 18:10:24 -08:00
Brian Anderson
57cad61353
rt: Remove task pinning. Does nothing
2012-02-02 18:10:24 -08:00
Brian Anderson
18de0f2aeb
rt: Rename task_sleep intrinsic to task_yield. Remove usec param
2012-02-02 18:10:24 -08:00
Brian Anderson
8693fcc2d7
rt: Remove yield timers
2012-02-02 18:10:24 -08:00
Niko Matsakis
196d69beb2
make boxes self-describing ( fixes #1493 )" (take 2)
...
this will be used to generate a new snapshot.
2012-02-01 18:52:08 -08:00
Niko Matsakis
3116643806
Revert "make boxes self-describing ( fixes #1493 )" until a new
...
snapshot is prepared.
2012-02-01 18:50:19 -08:00
Niko Matsakis
c36207bfb8
make boxes self-describing ( fixes #1493 )
2012-02-01 18:18:07 -08:00
Brian Anderson
4eb92d4177
rt: Don't access fields on null supervisor task
2012-02-01 16:46:11 -08:00
Brian Anderson
fa13fd9d64
rt: Remove set_min_stack
2012-01-29 21:27:37 -08:00
Brian Anderson
6548cdd59b
rt: Make the initial segment of the main task's stack 1MB
...
This is a trick to fool microbenchmarks. Closes #1681
2012-01-29 21:20:39 -08:00
Brian Anderson
94c389a25b
rt: Add RUST_MAX_STACK env var with 8MB default
...
Closes #1489
2012-01-11 13:57:11 -08:00
Niko Matsakis
110c3ccdca
add rust_task_is_unwinding predicate and do not kill if already unwinding
2012-01-09 19:53:32 -08:00
Brian Anderson
7e8974305c
rt: Set Linux red zone to 20K again
...
With runtime logging on it smashes the stack
2012-01-09 11:44:36 -08:00
Niko Matsakis
8506241f3a
fix how we walk functions to match new closure fmt
2012-01-06 22:40:31 -08:00
Niko Matsakis
25e81e34ea
rewrite task tests
2012-01-06 22:40:31 -08:00
Niko Matsakis
98f5109cde
simplify task impl
2012-01-06 22:40:31 -08:00
Brian Anderson
4632358cbc
Revert "rt: Reduce mac red zone to 6K"
...
This reverts commit d499e739a1
.
2012-01-06 18:16:19 -08:00
Brian Anderson
d499e739a1
rt: Reduce mac red zone to 6K
2012-01-06 16:42:26 -08:00
Brian Anderson
2f4c9315af
rt: Fail the scheduler immediately on task failure in win32
2012-01-06 16:18:56 -08:00
User Jyyou
a59c4b1b47
freebsd support
2012-01-01 20:18:55 -08:00
Brian Anderson
dedfef4c4c
Revert "wip"
...
This reverts commit aeadc6269e
.
2011-12-20 20:57:04 -08:00
Brian Anderson
aeadc6269e
wip
2011-12-20 20:15:09 -08:00
Brian Anderson
128621be97
rt: Remove rust_task::grow. Obsolete
2011-12-20 20:02:57 -08:00
Brian Anderson
cab4da70c8
rt: Don't check the stack canary on most upcalls
2011-12-20 16:50:54 -08:00
Brian Anderson
2a490d1cf8
Revert "rt: Reduce the mac red zone to 2K"
...
This reverts commit ba8f369f89
.
2011-12-20 15:17:30 -08:00