Brian Anderson
c2d8a4df35
Continue transition to an ivec-only main
...
Only generate a single main function. Rename rust_start_ivec to rust_start,
leaving a transitional rust_start_ivec in place.
2011-08-18 13:09:49 -07:00
Patrick Walton
f17edf9829
rustc: Use obstacks in lieu of dynamically-allocated frames only when the frame is actually dynamically-sized
2011-08-17 18:14:57 -07:00
Patrick Walton
df51fe36f1
Revert "rt: Use obstacks in lieu of dynamically-sized frames"
...
This reverts commit cc5fcfce89
.
2011-08-17 17:27:31 -07:00
Patrick Walton
cc5fcfce89
rt: Use obstacks in lieu of dynamically-sized frames
2011-08-17 17:24:57 -07:00
Eric Holk
ae89ea223d
Making more of the rust_task structure directly accessible from Rust.
2011-08-17 14:42:40 -07:00
Eric Holk
efac7c9a19
Yet another comm interface.
2011-08-17 14:42:40 -07:00
Patrick Walton
702fe5cdac
rustc: Run obstack cleanups at the end of each function
2011-08-17 13:58:49 -07:00
Patrick Walton
3aab46b020
rustc: Mark an obstack fencepost when entering a dynamically-sized frame
2011-08-17 13:16:15 -07:00
Patrick Walton
d8c5bd6195
rt: Implement obstacks, untested as of yet
2011-08-16 19:49:25 -07:00
Eric Holk
8686645aad
New channel-based task status notifications.
2011-08-16 16:47:40 -07:00
Eric Holk
3db300b06e
Removing port, chan and task shapes.
2011-08-16 12:30:32 -07:00
Eric Holk
89df915a13
Removing task, chan and port upcalls.
2011-08-16 11:22:24 -07:00
Brian Anderson
053b8bff5a
Accept main(args: [str]) as main signature
2011-08-16 10:29:08 -07:00
Eric Holk
76aab80e39
Disabling TRACK_ALLOCATIONS
2011-08-16 10:28:09 -07:00
Eric Holk
cf2def46c1
Removed trans_comm.rs from the compiler. Updating aio/sio to work with the new chan and port system, started on a networking module for the standard library.
2011-08-16 09:36:29 -07:00
Brian Anderson
977d8ba0e9
Abort abruptly on failure on windows
...
Trying to shutdown cleanly results in wierd failures
2011-08-15 19:25:47 -07:00
Eric Holk
5c6790519b
Reducing the chances for race conditions in join.
2011-08-15 12:39:55 -07:00
Eric Holk
3fd3f35699
Fixing win32 build.
2011-08-15 10:48:04 -07:00
Eric Holk
d63f8340a5
Properly ref counting to fix valgrind issues on linux.
2011-08-15 09:26:52 -07:00
Eric Holk
be7325073a
Removed spawn and task from the parser. Updated all the tests except for the benchmarks.
2011-08-15 09:26:52 -07:00
Eric Holk
b9f1f77622
Fixed memory accounting and task stack creation bugs.
2011-08-15 09:26:51 -07:00
Eric Holk
2f23405a60
Working on more spawn test cases.
2011-08-15 09:26:51 -07:00
Eric Holk
a332043561
Updating to build on Linux and Mac, and hopefully Windows too.
2011-08-15 09:26:51 -07:00
Eric Holk
b2dad8af31
Added a library version of spawn. Before long, we can remove the old version.
2011-08-15 09:26:51 -07:00
Eric Holk
39b16077bb
Port ID-based channels.
2011-08-15 09:26:51 -07:00
Eric Holk
04af99ecb0
First step towards port handles.
2011-08-15 09:26:51 -07:00
Brian Anderson
4fc0848a49
Rename rust_list_files_ivec to rust_list_files
2011-08-12 12:14:07 -07:00
Brian Anderson
8561f7654c
Remove rust_list_files from std and rt
2011-08-12 12:14:07 -07:00
Brian Anderson
d1b3ed8c3f
Remove runtime vector builtins
2011-08-12 12:14:07 -07:00
Brian Anderson
878fbac278
Remove str_from_vec runtime function
2011-08-12 12:08:27 -07:00
Brian Anderson
2e7e58812b
Remove vec version of str::bytes, rename bytes_ivec to str::bytes
2011-08-12 12:08:26 -07:00
Patrick Walton
ba7c8f18d4
rustc: Remove unused "trace" upcalls
2011-08-10 18:09:52 -07:00
Patrick Walton
347230b001
rt: Add the last few cases to polymorphic log
2011-08-10 15:45:32 -07:00
Patrick Walton
955ac84da4
rt: Step over type params properly in glue
2011-08-10 15:39:05 -07:00
Patrick Walton
15e1e3185d
rt: Allow records and boxes to be logged
2011-08-10 15:36:37 -07:00
Patrick Walton
6affa3264b
rt: Allow tags to be logged
2011-08-10 14:57:02 -07:00
Patrick Walton
f5c8c85196
rt: Implement logging of vectors
2011-08-10 14:42:06 -07:00
Patrick Walton
dc720c3aba
rt: Implement polymorphic log on strings
2011-08-10 14:35:12 -07:00
Patrick Walton
adce35acd4
rustc: Use polymorphic logging
2011-08-10 14:35:12 -07:00
Brian Anderson
0cd607bcbd
rt: Shutdown gracefully on failure
...
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-10 13:02:31 -07:00
Patrick Walton
f6ad051408
rt: Use _LP64 instead of SIZE_MAX and UINT64_MAX to try to put out the burning tinderbox
2011-08-10 10:55:41 -07:00
Patrick Walton
ceaf02abe1
rt: Attempt to quiet MinGW by including limits.h
2011-08-10 05:17:30 -07:00
Patrick Walton
6fbb7ffdbd
rt: Stub code for polymorphic log
2011-08-09 19:01:15 -07:00
Patrick Walton
1f8e0fa083
rt: Implement comparison of functions, objects, ports, channels, and tasks
2011-08-09 17:02:17 -07:00
Patrick Walton
ade998d743
rt: Don't walk vars twice. We self-host with compare glue now.
2011-08-09 17:02:17 -07:00
Patrick Walton
1e1125fcbe
rt: Initialize "result" in all constructors for cmp
2011-08-09 17:02:17 -07:00
Patrick Walton
e5533a5d5e
rt: Compare exterior vectors
2011-08-09 12:49:52 -07:00
Patrick Walton
b83167cf91
rt: Make comparison through type vars work
2011-08-09 12:19:40 -07:00
Patrick Walton
f9363f01a1
rt: Fix comparison of interior vectors
2011-08-09 12:19:40 -07:00
Patrick Walton
f7749b1608
rt: Add code to walk over interior vectors, untested as of yet
2011-08-08 19:16:33 -07:00
Patrick Walton
7d7f62613a
rt: Compare tags
2011-08-08 18:29:20 -07:00
Patrick Walton
e5531504c9
rt: Align when comparing the insides of boxes
2011-08-08 17:30:21 -07:00
Patrick Walton
0459e38bde
rt: Align mallocs to 16 byte boundaries
2011-08-08 17:30:21 -07:00
Eric Holk
42b13c1db3
Disabling TRACK_ALLOCATIONS
2011-08-08 17:12:44 -07:00
unknown
44bef5f2cb
Introduced task handles.
...
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-08-08 16:55:38 -07:00
Patrick Walton
f4f057ced1
rt: Compare the insides of boxes
2011-08-08 16:52:11 -07:00
Patrick Walton
42daeab7df
rt: "const foo const &" == "const foo &", duh. Puts out burning tinderbox.
2011-08-08 14:55:35 -07:00
Patrick Walton
eb7e9dce4d
rt: Stub the shape-based cmp upcall
2011-08-08 14:33:06 -07:00
Eric Holk
d9b84a546c
Converted the rest of the task-comm-* tests over. Also fixed some
...
channel lifecycle bugs.
2011-08-08 08:57:52 -07:00
Patrick Walton
0aeddb3673
rt: Stub compare glue
2011-08-05 18:47:12 -07:00
Patrick Walton
d7828e694d
rt: Uncomment data<T>
2011-08-05 17:50:59 -07:00
Eric Holk
50670eb426
Removing trailing whitespace in rust_shape.cpp
2011-08-05 17:08:22 -07:00
Patrick Walton
5261bd771f
rt: Simplify the signature of walk_tag; stub code for the data walker
2011-08-05 16:47:43 -07:00
Brian Anderson
f918418953
Fix a type in the libuv mingw makefile
2011-08-05 15:48:19 -07:00
Eric Holk
b62e80c1f0
Atomic ref counting for chans.
2011-08-05 15:27:28 -07:00
Eric Holk
200bbcf91b
Rewrote receive to return a value. This lets us initialize variables by receiving them.
2011-08-05 15:27:27 -07:00
Graydon Hoare
7da64ae461
Munge libuv makefiles sufficiently to build out of tree.
2011-08-05 11:57:07 -07:00
Brian Anderson
f6d5c56f21
Tweak libuv makefiles so they pick up custom CFLAGS
2011-08-05 11:57:07 -07:00
Brian Anderson
e653520a6f
Fix uv_buf_t declaration on win32
...
The fields of this structure are mysteriously defined in the opposite order
on windows as on unix
2011-08-05 11:57:06 -07:00
Rob Arnold
a4951cab7f
Add libuv Makefile
2011-08-05 11:57:06 -07:00
Rob Arnold
8229c3fa75
Update libuv to revision ee599ec1141cc48f895de1f9d148033babdf9c2a
2011-08-05 11:57:06 -07:00
Rob Arnold
f4b87c749f
Basic async IO module using libuv
2011-08-05 11:57:06 -07:00
Rob Arnold
b64a52df42
Integrate libuv into the build system
2011-08-05 11:57:06 -07:00
Rob Arnold
904f443fa9
Drop in libuv rev 2b5707d834a6b85b8e589ac04cb61a6db2dab94b
2011-08-05 11:57:06 -07:00
Rob Arnold
b6be83885f
Log tags in memory_region::{free,realloc}
...
Make this useful and consistent with the destructor.
2011-08-05 11:57:06 -07:00
Patrick Walton
6bb6922c28
rt: Change int to uint32_t. Put out burning tinderbox.
2011-08-04 09:50:11 -07:00
Patrick Walton
e351ad762d
rt: Stub shape glue and implement shape::print and shape::size_of.
2011-08-03 20:25:44 -07:00
Erick Tryzelaar
a8943f3442
timeout_in_ns was renamed to timeout_in_ms.
2011-08-03 19:28:49 -07:00
Eric Holk
7a2e9f4874
Sleep for a nonzero amount of time on Windows.
2011-08-03 18:21:19 -07:00
Brian Anderson
2298a2b29f
Whitespace cleanup
2011-08-03 16:25:38 -07:00
Brian Anderson
4ae6c835cb
Add some hacks to get stdin piping working more correctly in windows
...
The way pipes work in windows is not the same as unix, though I'm not
entirely clear on the differences. This patch changes the windows pipe
method to return non-inheritable fds, and the windows rust_run_program
method to duplicate them before spawning the new process.
This allows make-check-pretty to work on windows.
2011-08-03 15:09:00 -07:00
Eric Holk
286be2d94e
Adding an intrinsic for recv.
2011-08-01 18:43:05 -07:00
Eric Holk
939bca0d84
Added send and receive to comm library.
2011-08-01 15:58:39 -07:00
Eric Holk
6a6d5c669e
Enabling logging in circular_buffer again.
2011-08-01 15:58:39 -07:00
Eric Holk
b3d9d9b73c
Objectified library chans and ports.
2011-08-01 15:58:30 -07:00
Eric Holk
5a673cc2c9
Started working on a library-based comm system. Creating and deleting ports work.
2011-08-01 15:58:30 -07:00
Brian Anderson
7b87fa3683
Replace a lock/unlock with scoped_lock in rust_scheduler::create_task
2011-08-01 11:01:59 -07:00
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
Brian Anderson
9dbe6941c4
Add sched_threads rt function to get the number of scheduler threads
2011-07-29 21:03:17 -07:00
Eric Holk
d1dbb99984
Removing proxies and message queues.
2011-07-29 18:54:59 -07:00
robarnold
bdf2daee1e
Merge pull request #781 from robarnold/upstream-stable
...
More useful leak debugging output.
2011-07-29 09:13:20 -07:00
Brian Anderson
3dd522b6b7
Add an assertion about the lock in rust_chan::disassociate
2011-07-28 16:04:49 -07:00
Brian Anderson
73812cd3de
Turn off TRACK_ALLOCATIONS
2011-07-28 14:52:50 -07:00
Brian Anderson
4b356097c2
Change the locking rules around channel disassociation again
...
This prevents port's destructor from accessing a deleted channel
2011-07-28 14:25:20 -07:00
Brian Anderson
5c0fd045ce
Fiddle with the locking around channel disassociation
...
This still looks a bit sketchy to me (why isn't there locking in
port::destroy?) but this manages to get rid of a problem with channels
accessing their task after it's NULL.
2011-07-28 12:53:44 -07:00
Brian Anderson
b54eb0480d
No strnlen on mac
2011-07-28 12:53:14 -07:00
Brian Anderson
0fcd72c932
When using the allow leaks hack don't even print a warning about the leak
...
This is only used for the test runner and in that case it just makes the test
output confusing
2011-07-28 12:23:01 -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
Brian Anderson
75985ab75e
Remove color-related code from rust_log
...
This is all dead. If someone decides they want color it will be easy to redo.
2011-07-28 12:23:00 -07:00
Eric Holk
3d7016ae95
Updating to work on Windows.
2011-07-28 10:47:29 -07:00
Eric Holk
9618ab67ae
Re-enabled the rest of the asserts and things in rust_chan.cpp
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
279844ce9f
Atomic reference counting for tasks.
2011-07-28 10:47:28 -07:00
Eric Holk
a5fe66e706
Adding upcalls to to ref() and deref() tasks. This is the first step towards atomic reference counting of tasks.
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
e697a52359
Adding a function to stdlib to set the min stack size, for programs
...
that absolutely will not succeed with a large default stack. This
should be removed once we have stack grown working.
Also updated word-count to succeed under the new test framework.
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
Rob Arnold
f45ac8db07
More useful leak debugging output.
...
When printing out leaked allocations, print the allocation tag and address of
the returned pointer.
2011-07-28 08:28:32 -07:00
Marijn Haverbeke
73e8e49897
More thorough check for interior-ness in str_from_ivec
...
Closes #750
2011-07-27 21:46:14 +02:00
Brian Anderson
49a98f1508
Base scheduler threads on number of cores. Closes #739
2011-07-26 11:12:20 -07:00
Graydon Hoare
42e57f64b7
remove datalayout from the intrinsics.ll.in file, silence linkage warning.
2011-07-25 11:50:09 -07:00
Eric Holk
57459ec8ae
Fixed another concurrency issue in channels.
2011-07-23 12:21:23 -07:00
Eric Holk
8878b128ba
More work on word-count.
...
Updated the MapReduce protocol so that it's correct more often. It's
still not perfect, but the bugs repro less often now.
Also found a race condition in channel sending. The problem is that
send and receive both need to refer to the _unread field in
circular_buffer. For now I just grabbed the port lock to send. We can
probably get around this by using atomics instead.
2011-07-22 18:45:34 -07:00
Eric Holk
75ee817713
Fixing a use of uninitialized memory error in valgrind.
2011-07-22 16:05:51 -07:00
Michael Sullivan
f33309502a
Bump the stack size and make the RUST_MIN_STACK env variable accept hex values.
2011-07-21 14:05:51 -07:00
Eric Holk
d79afd7916
Improving move semantics for channel operations.
...
This lets us un-XFAIL task-comm-10.rs.
2011-07-21 11:51:22 -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
Brian Anderson
a467e8e4e6
Add a huge hack to allow the test runner to continue if a single task leaks
...
This is just until unwinding works. Adds a flag to the runtime to turn
the memory leak checks on task destruction into warnings instead of fatal
errors. I am so sorry.
Issue #428
2011-07-20 10:22:18 -07:00
Brian Anderson
652214d7f9
Fix calculation of sizeof boxed ivec of str in rt. Closes #712
2011-07-19 16:55:45 -07:00
Brian Anderson
20a3adbc08
Revert "Add setenv to standard library"
...
This reverts commit 6fb168b3db
.
2011-07-17 19:16:18 -07:00
Brian Anderson
6fb168b3db
Add setenv to standard library
2011-07-17 18:50:01 -07:00
Patrick Walton
88574c3cea
rustc: Implement interior string logging in DPS
2011-07-15 18:37:57 -07:00
Brian Anderson
7d475530a0
Remove task_unsupervise from rt builtin functions
...
This was an exact duplicate of the unsupervise function
2011-07-15 10:07:32 -07:00
Brian Anderson
ced8393f20
Modify task::join to indicate how the task terminated
...
This involves sticking yet another field into the task structure
2011-07-15 10:07:29 -07:00
Brian Anderson
f634ab45bc
Add task_unsupervise to rustrt.def.in
2011-07-14 19:14:36 -07:00
Brian Anderson
c99e110119
Modify upcall_fail so that failing tasks relinquish control to the scheduler
...
This is sufficient to let unsupervised tasks that don't allocate fail without
crashing or leaking.
2011-07-14 18:49:18 -07:00
Brian Anderson
01a52d728c
Add an unsupervise builtin and function to std::task
...
Calling task::unsupervise de-parents the current task, with the result
that failures do not propogate up the task tree.
2011-07-14 17:56:59 -07:00
Brian Anderson
4738cf83b0
Move the responsibility for process failure from tasks to the scheduler
...
When the root task fails the process fails. Failures on other tasks propagate
up the task tree. Failures on non-root tasks without parents just
(theoretically) unwind and disappear.
2011-07-14 17:44:39 -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
d39f84d8ec
Trim a few more fail(1)s, not sure how they slipped past.
2011-07-13 14:04:38 -07:00
Graydon Hoare
336a4df778
Remove 'Nop.' comments, add emacs lines, remove obsolete file.
2011-07-13 14:03:18 -07:00
Graydon Hoare
49116adbe9
Fix compile-command lines in rt.
2011-07-13 13:51:20 -07:00
Graydon Hoare
2e2951305d
Remove obsolete nargs counts from runtime.
2011-07-13 13:43:35 -07:00
Graydon Hoare
01fc165517
Attempt to correct buggy win32 timer code (causing tinderbox failures).
2011-07-13 12:25:36 -07:00
Patrick Walton
598b50e10a
stdlib: Move fs over to interior vectors by introducing a rust_list_files_ivec builtin
2011-07-12 15:14:57 -07:00
Patrick Walton
a9b77a5011
rt: Remove the locks around upcall_shared_malloc and upcall_shared_free
2011-07-12 11:53:45 -07:00
Patrick Walton
eef61a527d
stdlib: Add addr_of() to the standard library
2011-07-11 14:25:35 -07:00
Patrick Walton
7efb942639
rt: Remove the now-unused upcall_ivec_resize and upcall_ivec_spill, which allocated from the wrong heap
2011-07-10 01:30:45 -07:00
Patrick Walton
d30f22eb65
rt: Remove the _2 prefix from intrinsics; all rust-intrinsics now use explicit return pointers
2011-07-10 01:20:18 -07:00
Patrick Walton
f42c94740a
rustc: Make rust-intrinsics take an explicit return pointer
2011-07-09 21:13:25 -07:00
Patrick Walton
e823ca4965
stdlib: Implement casts. The horror.
2011-07-09 20:14:47 -07:00
Patrick Walton
91d45b91e6
stdlib: Implement str::unsafe_from_bytes_ivec()
2011-07-08 22:23:11 -07:00
Patrick Walton
aa0f6f4961
stdlib: Add an offset function for simple pointer arithmetic on unsafe pointers
2011-07-08 21:56:15 -07:00
Eric Holk
d7db25e8f6
Added an environment variable to override the minimum stack size. Closes #637 .
2011-07-08 11:36:56 -07:00
Eric Holk
3958c72cd8
Some cleanup
2011-07-07 18:32:45 -07:00
Eric Holk
4739953b84
Fixed two races.
...
The first is that the memory_region destructor would complain there is
still an outstanding allocation. This is because circular_buffer from
rust_chan wasn't refing its task, so the task was being destructed too
soon.
The second was where the program could deadlock while joining a
task. The target task would die in the time between checking whether
the task should block and then actually blocking. The fix is to use
the target task's lock.
2011-07-07 18:22:27 -07:00
Eric Holk
f6e37f659c
Made TRACK_ALLOCATIONS add only constant time overhead. This makes it
...
feasible to turn it on and run rustc.
2011-07-07 18:22:27 -07:00