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.
This commit is contained in:
parent
8f2254b8c2
commit
8878b128ba
6 changed files with 134 additions and 36 deletions
|
|
@ -5,6 +5,9 @@ native "rust" mod rustrt {
|
|||
fn unsupervise();
|
||||
fn pin_task();
|
||||
fn unpin_task();
|
||||
fn clone_chan(*rust_chan c) -> *rust_chan;
|
||||
|
||||
type rust_chan;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -44,6 +47,11 @@ fn unpin() {
|
|||
rustrt::unpin_task();
|
||||
}
|
||||
|
||||
fn clone_chan[T](chan[T] c) -> chan[T] {
|
||||
auto cloned = rustrt::clone_chan(unsafe::reinterpret_cast(c));
|
||||
ret unsafe::reinterpret_cast(cloned);
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// mode: rust;
|
||||
// fill-column: 78;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue