Commit Graph

1157 Commits

Author SHA1 Message Date
Brian Anderson
3de30f4ef2 rt: Change alignof to rust_alignof. Remove -Wno-c++11-compat. Closes #1644 2012-03-12 18:03:48 -07:00
Brian Anderson
db79f3c0a5 rt: Remove arbitrary limit on size of port queue. Closes #1245 2012-03-12 13:24:09 -07:00
Brian Anderson
dc0b9f44e2 rt: Change the rust_port refcounting scheme to avoid races
Hopefully...
2012-03-06 17:14:40 -08:00
Brian Anderson
ee991cae81 rt: Add a hack to fix a port detach bug 2012-03-05 20:02:25 -08:00
Brian Anderson
958c321083 rt: Fix the atomic get_ref_count method to avoid races 2012-03-05 19:39:56 -08:00
Brian Anderson
1347d04bb0 rt: Properly block tasks while waiting for port detach 2012-03-05 19:39:56 -08: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
f057f00300 rt: Simplify reap_dead_tasks 2012-03-05 19:39:56 -08:00
Brian Anderson
8efe4b8913 rt: Add an assert to the scheduler loop 2012-03-05 19:39:56 -08:00
Brian Anderson
e08f46db68 rt: Move receive code into rust_port 2012-03-05 19:39:56 -08:00
Brian Anderson
77295c56c5 rt: Simplify the recv interface 2012-03-05 19:39:56 -08:00
Brian Anderson
8e0efce0da rt: Move some code from rust_port_detach into rust_port::detach 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
Graydon Hoare
e400733e90 Extra removal, missed by last commit. 2012-03-05 16:02:38 -08:00
Graydon Hoare
6c87c34277 Remove dead code from rt (debug_obj, rust_obj, rust_closure, rust_box_obj, rust_vtable) 2012-03-05 15:50:11 -08:00
Brian Anderson
3a4c96a196 rt: Remove virtual methods from memory_region, rust_srv 2012-03-05 14:47:24 -08:00
Brian Anderson
38b2b74413 rt: Move RUST_POISON_ON_FREE into rust_env 2012-03-02 20:13:52 -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
f4ce965ce7 rt: Port ref counts are protected by the task lock. Ick. 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
Niko Matsakis
def72bda47 retool inline encoding to handle methods, fix tests 2012-03-02 06:47:25 -08:00
Brian Anderson
96f565492d rt: Make fields of rust_task_thread private where possible 2012-03-01 21:41:11 -08:00
Brian Anderson
b6c57dbba2 rt: rust_task_thread isn't ref counted 2012-03-01 21:19:12 -08:00
Brian Anderson
084a699a7a rt: Remove vec_append.ll
This looks like just a random snippet of llasm.
2012-03-01 18:20:40 -08:00
Brian Anderson
5df44bd066 rt: Remove rust_kernel::live_tasks. Unused 2012-03-01 14:53:20 -08:00
Niko Matsakis
7d0958f70f add the ability to snag the frame so we can verify that we are inlining 2012-02-29 11:54:47 -08:00
Erick Tryzelaar
d3331bce98 rt: strings should escape chars like '\n' as '\n' 2012-02-28 18:05:25 -08:00
Brian Anderson
8d617e638e rt: Reset the stack boundary after returning from crust functions 2012-02-28 17:56:15 -08:00
Jeff Olson
b79b5739c9 add rust_uv_loop_delete to rustrt.def.in 2012-02-28 17:56:15 -08:00
Jeff Olson
b4c88cdcec add uv::loop_delete()
because of the last change, the loop ptr is no longer cleaned up
when the loop exits. This api call addresses that. Sadly, the loop
ptr is not "reusable" across multiple calls to uv::run().
2012-02-28 17:56:15 -08:00
Jeff Olson
0b3a06ab2c correcting for libuv behavior that differs between linux & windows
net complexity increase :/
2012-02-28 17:56:15 -08:00
Jeff Olson
bb5960aa57 moving new uv stuff into uv.rs and rust_uv.cpp
- removing the remains of uvtmp.rs and rust_uvtmp.rs
- removing the displaced, low-level libuv bindings
in uv.rs and rust_uv.cpp
2012-02-28 17:56:15 -08:00
Jeff Olson
cf08ed6458 fzzzy's patch for rustrt.def.in
adds new c/c++ methods bound in rust for uvtmp::uv
2012-02-28 17:56:15 -08:00
Jeff Olson
1d3e08d8c6 finishing up simple uv_timer impl
as it stands, basic async nad timer support is added
2012-02-28 17:56:15 -08:00
Jeff Olson
b68eb507da cleaning up uv_async stuff and stubbing uv_timer 2012-02-28 17:56:14 -08:00
Jeff Olson
974c23cbeb removed hello world and added uv_async_* 2012-02-28 17:56:14 -08:00
Jeff Olson
ffad8d7f0c everything is laid out and working through a basic hw
the core impl is there, with a async handle in place
to take incoming operations from user code. No actual
uv handle/operations are implemented yet, though.
2012-02-28 17:56:14 -08:00
Niko Matsakis
a1b2f34bd0 remove temp sanity check 2012-02-28 06:31:28 -08:00
Brian Anderson
7e9aa6c3c2 rt: Don't zero new stacks 2012-02-27 16:13:51 -08:00
Brian Anderson
b3f77bf927 rt: Change the way the kernel exits to avoid pthread leaks
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-27 14:25:32 -08:00
Brian Anderson
e4c027446e Revert "rt: Reconfigure the C stack for valgrind each time it's used"
This reverts commit 859e025652.

This ended up not fixing the '0 bytes lost' problem and has some performance
impact.
2012-02-27 14:01:36 -08:00
Brian Anderson
21650d0212 rt: Remove unused forward declaration of rust_realloc_shared 2012-02-26 16:43:42 -08:00
Brian Anderson
7d1e36a315 rt: Remove ptr_vec. Unused 2012-02-26 16:24:37 -08:00
Brian Anderson
4d03e4b711 rt: Remove smart_ptr. Unused 2012-02-26 16:23:37 -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
Marijn Haverbeke
b1d7f252a9 Remove unused tydesc argument to upcall_shared_malloc 2012-02-21 17:08:14 +01:00
Brian Anderson
4220dcf1e9 core: New task API 2012-02-20 18:58:04 -08:00
Chris Peterson
fed81c2cfc rt: Add some lock_and_signal assertions
Assert that locks are not reentered on the same thread, unlocked by a
different thread, or deleted while locked.
2012-02-19 23:15:35 -08:00
Chris Peterson
9f49293232 rt: Initialize Windows CRITICAL_SECTION with non-zero spin count
If a CRITICAL_SECTION is not initialized with a spin count, it will
default to 0, even on multi-processor systems. MSDN suggests using
4000. On single-processor systems, the spin count parameter is ignored
and the critical section's spin count defaults to 0.

For Windows >= Vista, extra debug info is allocated for
CRITICAL_SECTIONs but not released in a timely manner. Consider using
InitializeCriticalSectionEx(CRITICAL_SECTION_NO_DEBUG_INFO).
2012-02-19 23:13:31 -08:00
Chris Peterson
159dfd7c3b rt: Delete Windows CRITICAL_SECTION in dtor 2012-02-19 23:11:03 -08:00
Chris Peterson
3d202d7eae rt: rename nano_time() builtin to match time::precise_time_ns() 2012-02-18 01:39:42 -08:00
Chris Peterson
123a920f59 std: Fix Windows system time conversion for get_time() 2012-02-18 01:21:26 -08:00
Brian Anderson
54d7bffbb8 rt: Make upcall_vec_push an intrinsic 2012-02-17 12:08:03 -08:00
Brian Anderson
db62154062 rt: Don't take the lock when reallocing in the kernel memory region 2012-02-17 11:37:17 -08:00
Brian Anderson
d23cd8f52f rt: Don't hit TLS on upcall_vec_push unless necessary 2012-02-17 11:37:17 -08:00
Brian Anderson
a3fdd8c93f rt: Don't log on entry to upcall_vec_push. Also slow 2012-02-17 11:37:17 -08:00
Brian Anderson
fca8e9e621 rt: Don't do the stack canary check in upcall_vec_push. Too slow 2012-02-17 11:37:17 -08:00
Brian Anderson
e0b2fd8417 rt: Simplify upcall_vec_push 2012-02-17 11:37:17 -08:00
Brian Anderson
853e2003b8 rt: Make the stack canary just a word on the stk_seg struct 2012-02-17 11:37:17 -08:00
Brian Anderson
75503570c7 rt: Untabify rust_port_selector.cpp 2012-02-16 12:53:21 -08:00
Brian Anderson
96af6f05a1 rt: Randomize port selection 2012-02-16 12:53:21 -08:00
Brian Anderson
b2cfb7ef82 rt: Add rust_port_select function 2012-02-16 11:12:22 -08:00
Brian Anderson
859e025652 rt: Reconfigure the C stack for valgrind each time it's used 2012-02-14 15:11:56 -08:00
Brian Anderson
a53a08e1b9 rt: Don't allocate a C stack for tasks that already have one 2012-02-14 13:51:15 -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
a393fb3221 rt: Maintain stack ptrs correctly when returning from stack switches 2012-02-14 11:24:09 -08:00
Brian Anderson
214cdd0dee rustc: Translate crust functions 2012-02-14 11:24:09 -08:00
Brian Anderson
4cc1e31f74 rt: Add a Rust callback debugging function 2012-02-14 11:24:09 -08:00
Ted Horst
a7a1152db5 put fflush back in 2012-02-10 19:42:32 -08:00
Ted Horst
36d5074f8f log to stderr instead of stdout
includes rustc diagnostics
runtest updated to check stderr for errors
2012-02-10 19:42:32 -08:00
Brian Anderson
b9e0ee8e7e rt: Add docs to stack functions 2012-02-10 12:58:35 -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
dd0ae80e63 rt: Account for the size of stack_canary in create_stack 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
8e55d3130a rt: Use 100k stacks for scheduler threads 2012-02-10 11:53:30 -08:00
Marijn Haverbeke
d01e7cd340 Represent boxed ifaces in a way similar to functions
They are now a (dictptr, box) pair, where box is a regular boxed
representation of the inner type. This cuts down on some special
case code.

Also removes some code from trans::base that was moved to shape but
then somehow restored in trans::base through a bad merge.

Starts on issue #1567
2012-02-10 12:36:57 +01: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
dff256cd19 rt: Move valgrind stack configuration out of the hot path 2012-02-09 21:27:50 -08:00
Brian Anderson
81e1564a7d rt: Detach pthreads before exiting
Joinable pthreads need to be either joined or detached and we no
longer join with the scheduler threads.
2012-02-09 19:00:16 -08:00
Brian Anderson
5d8d591ffc rt: Remove sync::yield and sync::sleep 2012-02-09 19:00:16 -08:00