Commit Graph

107 Commits

Author SHA1 Message Date
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
Eric Holk b62e80c1f0 Atomic ref counting for chans. 2011-08-05 15:27:28 -07:00
Rob Arnold f4b87c749f Basic async IO module using libuv 2011-08-05 11:57:06 -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 5a673cc2c9 Started working on a library-based comm system. Creating and deleting ports work. 2011-08-01 15:58:30 -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
Eric Holk d1dbb99984 Removing proxies and message queues. 2011-07-29 18:54:59 -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 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 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
Patrick Walton 88574c3cea rustc: Implement interior string logging in DPS 2011-07-15 18:37:57 -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
Graydon Hoare 39151f2ad8 Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases. 2011-07-13 15:44:09 -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 a9b77a5011 rt: Remove the locks around upcall_shared_malloc and upcall_shared_free 2011-07-12 11:53:45 -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
Eric Holk 8acadb17c2 Work on debugging race conditions.
Ports and channels have been moved to the kernel pool, since they've
been known to outlive their associated task. This probably isn't the
right thing to do, the life cycle needs fixed instead.

Some refactorying in memory_region.cpp. Added a helper function to
increment and decrement the allocation counter. This makes it easier
to switch between atomic and non-atomic increments. Using atomic
increments for now, although this still does not fix the problem.
2011-07-07 18:22:27 -07:00
Eric Holk a0f45f4456 Removing most of the locks in rust_upcall.cpp and elsewhere. 2011-07-07 18:22:27 -07:00
Rob Arnold f6117173c9 Allocate rust_ivec buffers out of the kernel pool
The duplication of upcalls is due to the fact that the runtime is
shared between stage0/rustc and stage1/rustc. Once snapshots are
updated, they should be de-duplicated.
2011-07-06 20:41:24 -07:00
Patrick Walton 91eb63eaee rt: Add a stack check to upcall_get_type_desc 2011-07-06 15:07:04 -07:00
Rob Arnold 73cc624e8e Move the channel destroy code into rust_chan.
This lets native code more easily destroy channels since directly deleting a
channel is not always the right way to destroy it.
2011-07-01 16:59:10 -07:00
Rob Arnold 09921cf86f Move channel cloning logic into a method on rust_chan.
This will allow us to more easily clone channels from native code.
2011-07-01 16:59:10 -07:00
Patrick Walton be50cdd24a rt: Add room for the new fill slot when resizing interior vectors 2011-06-30 11:35:05 -07:00
Graydon Hoare c796a8f24d Re-enable tidy (it was broken) and fix various non-tidy things. 2011-06-29 15:14:55 -07:00
Patrick Walton a2ce532337 rt: Remove the lock around upcall_vec_append. Add a test case. Closes #156. 2011-06-29 10:33:51 -07:00
Patrick Walton 74f8eb51ae rustc: Move duplicate_heap_parts to copy glue; add a test case 2011-06-28 17:59:30 -07:00
Patrick Walton dfcfef41df rustc: Rename take glue to copy glue 2011-06-28 16:52:59 -07:00
Eric Holk 866ee6ecb4 Re-enabling some tests. 2011-06-28 16:12:34 -07:00
Eric Holk 657e5a2bd5 Renamed what's left of rust_dom to rust_scheduler 2011-06-28 16:12:33 -07:00
Eric Holk 49a8cb34d2 Removed dom_owned, splitting things between task_owned and kernel_owned. Had to re-xfail a few tests brson recently un-xfailed. 2011-06-28 16:12:33 -07:00
Eric Holk f6f945fed5 Moved thread management to rust_kernel. 2011-06-28 16:12:33 -07:00
Eric Holk c6d8324830 There is only one domain per kernel now. 2011-06-28 16:12:33 -07:00
Michael Sullivan 99b4fff4d2 Properly handle the case where src==dst but we have to allocate a new vector. 2011-06-27 12:34:45 -07:00
Michael Sullivan 8ad7f3b56b Properly handle the case where src==dst in upcall_vec_append. 2011-06-27 12:34:44 -07:00
Graydon Hoare bc9fa31618 A little tidying in rt. 2011-06-27 10:08:57 -07:00
Eric Holk 681c063ec0 Conservatively serialize nearly all upcalls. Successfuly ran make check with RUST_THREADS=8, so we're probably fairly safe now. In the future we can relax the synchronization to get better performance. 2011-06-27 09:58:39 -07:00
Eric Holk 6367bcf427 Fixed a few concurrency bugs. Still not perfect, but overall it seems much more reliable. 2011-06-27 09:58:39 -07:00
Eric Holk a2dcd08cc2 Added string duplication to deep_copy. Closes #520. 2011-06-20 13:47:02 -07:00
Eric Holk 6ed6791df4 Removing dead upcall_join. Closes #509. 2011-06-16 12:23:13 -07:00
Michael Sullivan bd8f6097a7 Get rid of old vec_append glue. 2011-06-16 11:58:29 -07:00
Eric Holk 67360ae618 Fixed a problem where spawn arguments were getting lost again. Also, fixed up stack alignment, which closes #496 2011-06-15 18:16:59 -07:00
Eric Holk c4f9bd9470 Re-enabled join. 2011-06-15 18:16:59 -07:00
Patrick Walton ac743cfcb0 Merge pull request #490 from msullivan/fix_vec_append
Move the implementation of vec_append from llvm assembly to a regular upcall
2011-06-14 18:32:04 -07:00
Patrick Walton c6be352f73 rustc: Implement on-heap resizing for interior vectors 2011-06-14 18:23:13 -07:00