about summary refs log tree commit diff
path: root/src/rt/rust_chan.cpp
AgeCommit message (Collapse)AuthorLines
2011-11-11rt: Remove rust_chanBrian Anderson-53/+0
2011-11-10rt: Move rust_chan::send to rust_port::sendBrian Anderson-26/+0
2011-11-10rt: Simplify channel-port associationBrian Anderson-40/+7
It turns out that there's only ever a single channel per port these days, and it always has the same lifetime as the port, so we don't need a list or a complex association protocol.
2011-08-25Cleaning up task and comm exports, updating all the test cases.Eric Holk-1/+1
2011-08-08Introduced task handles.unknown-4/+5
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-08Converted the rest of the task-comm-* tests over. Also fixed someEric Holk-27/+3
channel lifecycle bugs.
2011-08-05Atomic ref counting for chans.Eric Holk-6/+5
2011-07-29Removing proxies and message queues.Eric Holk-68/+39
2011-07-28Add an assertion about the lock in rust_chan::disassociateBrian Anderson-1/+3
2011-07-28Change the locking rules around channel disassociation againBrian Anderson-1/+3
This prevents port's destructor from accessing a deleted channel
2011-07-28Fiddle with the locking around channel disassociationBrian Anderson-2/+1
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-28Re-enabled the rest of the asserts and things in rust_chan.cppEric Holk-12/+11
2011-07-28Resurrecting some of the logging in rust_chan.cppEric Holk-12/+12
2011-07-28Atomic reference counting for tasks.Eric Holk-15/+3
2011-07-28Per-thread scheduling. Closes #682.Eric Holk-25/+25
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-23Fixed another concurrency issue in channels.Eric Holk-0/+2
2011-07-22More work on word-count.Eric Holk-3/+8
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-21Improving move semantics for channel operations.Eric Holk-5/+5
This lets us un-XFAIL task-comm-10.rs.
2011-07-21Lots of work on memory tracking and channels.Eric Holk-13/+15
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-13Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.Graydon Hoare-1/+1
2011-07-13Fix compile-command lines in rt.Graydon Hoare-1/+1
2011-07-07Some cleanupEric Holk-1/+1
2011-07-07Work on debugging race conditions.Eric Holk-6/+8
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-01Sync rust_chan's deref() method with rustc's code.Rob Arnold-0/+1
If the channel is associated with a port then the destructor will assert. Additionally, destruction of the object is not always appropriate. This brings the deref() method into sync with the behavior of generated rust code which only invokes destroy() once the reference count goes to 0.
2011-07-01Move the channel destroy code into rust_chan.Rob Arnold-0/+35
This lets native code more easily destroy channels since directly deleting a channel is not always the right way to destroy it.
2011-07-01Move channel cloning logic into a method on rust_chan.Rob Arnold-0/+19
This will allow us to more easily clone channels from native code.
2011-06-29Re-enable tidy (it was broken) and fix various non-tidy things.Graydon Hoare-1/+2
2011-06-28Renamed what's left of rust_dom to rust_schedulerEric Holk-6/+6
2011-06-28Removed dom_owned, splitting things between task_owned and kernel_owned. Had ↵Eric Holk-1/+1
to re-xfail a few tests brson recently un-xfailed.
2011-06-27Conservatively serialize nearly all upcalls. Successfuly ran make check with ↵Eric Holk-3/+4
RUST_THREADS=8, so we're probably fairly safe now. In the future we can relax the synchronization to get better performance.
2011-06-27Added some locking to ports to prevent the case where two threads ↵Eric Holk-0/+3
simultaneously wake up a task blocked on a certain port.
2011-04-19Overhaul logging system in runtimeMarijn Haverbeke-9/+7
See https://github.com/graydon/rust/wiki/Logging-vision The runtime logging categories are now treated in the same way as modules in compiled code. Each domain now has a log_lvl that can be used to restrict the logging from that domain (will be used to allow logging to be restricted to a single domain). Features dropped (can be brought back to life if there is interest): - Logger indentation - Multiple categories per log statement - I possibly broke some of the color code -- it confuses me
2011-04-07Move to macro-based logging checks in the C++ codeMarijn Haverbeke-5/+5
No functions should be called for log statements that turn out to be inactive.
2010-09-07Lots of design changes around proxies and message passing. Made it so that ↵Michael Bebenita-13/+12
domains can only talk to other domains via handles, and with the help of the rust_kernel.
2010-08-09Synthesize a flush_chan upcall right before a channel's ref_count drops to ↵Michael Bebenita-7/+20
zero. This should only happen in the Rust code and not in the drop glue, or on the unwind path. This change allows the task owning the channel to block on a flush and delete its own channel. This change also cleans up some code around rust_port and rust_chan.
2010-07-28Move ports out into their own file, add data_message and make communication ↵Michael Bebenita-30/+51
system use it (and proxies) instead of existing token scheme.
2010-07-28Add modeline / file-local emacs var blocks.Michael Bebenita-0/+11
2010-07-28Wrap long lines.Michael Bebenita-2/+2
2010-07-19Added a message passing system based on lock free queues for inter-thread ↵Michael Bebenita-13/+41
communication. Channels now buffer on the sending side, and no longer require blocking when sending. Lots of other refactoring and bug fixes.
2010-06-23Populate tree.Graydon Hoare-0/+34