Skip to content

Commit 02e907b

Browse files
committed
Remove oldcomm from the test suite
1 parent 28ed9dc commit 02e907b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+207
-1778
lines changed

src/test/auxiliary/cci_capture_clause.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::oldcomm::*;
11+
use core::pipes::*;
1212

1313
pub fn foo<T: Owned Copy>(x: T) -> Port<T> {
14-
let p = Port();
15-
let c = Chan(&p);
16-
do task::spawn() |copy c, copy x| {
14+
let (p, c) = stream();
15+
do task::spawn() |copy x| {
1716
c.send(x);
1817
}
1918
p

src/test/auxiliary/test_comm.rs

-127
This file was deleted.

src/test/bench/graph500-bfs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use std::deque;
2626
use std::deque::Deque;
2727
use std::par;
2828
use core::io::WriterUtil;
29-
use core::oldcomm::*;
3029
use core::int::abs;
3130

3231
type node_id = i64;

src/test/bench/msgsend-ring.rs

-88
This file was deleted.

src/test/bench/shootout-chameneos-redux.rs

+27-32
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ extern mod std;
1414
use std::map;
1515
use std::map::HashMap;
1616
use std::sort;
17+
use std::cell::Cell;
18+
use core::pipes::*;
1719

1820
fn print_complements() {
1921
let all = ~[Blue, Red, Yellow];
@@ -98,18 +100,18 @@ fn transform(aa: color, bb: color) -> color {
98100
fn creature(
99101
name: uint,
100102
color: color,
101-
from_rendezvous: oldcomm::Port<Option<CreatureInfo>>,
102-
to_rendezvous: oldcomm::Chan<CreatureInfo>,
103-
to_rendezvous_log: oldcomm::Chan<~str>
103+
from_rendezvous: Port<Option<CreatureInfo>>,
104+
to_rendezvous: SharedChan<CreatureInfo>,
105+
to_rendezvous_log: SharedChan<~str>
104106
) {
105107
let mut color = color;
106108
let mut creatures_met = 0;
107109
let mut evil_clones_met = 0;
108110
109111
loop {
110112
// ask for a pairing
111-
oldcomm::send(to_rendezvous, CreatureInfo {name: name, color: color});
112-
let resp = oldcomm::recv(from_rendezvous);
113+
to_rendezvous.send(CreatureInfo {name: name, color: color});
114+
let resp = from_rendezvous.recv();
113115
114116
// log and change, or print and quit
115117
match resp {
@@ -126,7 +128,7 @@ fn creature(
126128
// log creatures met and evil clones of self
127129
let report = fmt!("%u", creatures_met) + ~" " +
128130
show_number(evil_clones_met);
129-
oldcomm::send(to_rendezvous_log, report);
131+
to_rendezvous_log.send(report);
130132
break;
131133
}
132134
}
@@ -135,61 +137,54 @@ fn creature(
135137
136138
fn rendezvous(nn: uint, set: ~[color]) {
137139
138-
pub fn spawn_listener<A: Owned>(+f: fn~(oldcomm::Port<A>)) -> oldcomm::Chan<A> {
139-
let setup_po = oldcomm::Port();
140-
let setup_ch = oldcomm::Chan(&setup_po);
141-
do task::spawn |move f| {
142-
let po = oldcomm::Port();
143-
let ch = oldcomm::Chan(&po);
144-
oldcomm::send(setup_ch, ch);
145-
f(move po);
146-
}
147-
oldcomm::recv(setup_po)
148-
}
149-
150140
// these ports will allow us to hear from the creatures
151-
let from_creatures: oldcomm::Port<CreatureInfo> = oldcomm::Port();
152-
let from_creatures_log: oldcomm::Port<~str> = oldcomm::Port();
141+
let (from_creatures, to_rendezvous) = stream::<CreatureInfo>();
142+
let to_rendezvous = SharedChan(to_rendezvous);
143+
let (from_creatures_log, to_rendezvous_log) = stream::<~str>();
144+
let to_rendezvous_log = SharedChan(to_rendezvous_log);
153145
154146
// these channels will be passed to the creatures so they can talk to us
155-
let to_rendezvous = oldcomm::Chan(&from_creatures);
156-
let to_rendezvous_log = oldcomm::Chan(&from_creatures_log);
157147
158148
// these channels will allow us to talk to each creature by 'name'/index
159-
let to_creature: ~[oldcomm::Chan<Option<CreatureInfo>>] =
149+
let to_creature: ~[Chan<Option<CreatureInfo>>] =
160150
vec::mapi(set, |ii, col| {
161151
// create each creature as a listener with a port, and
162152
// give us a channel to talk to each
163153
let ii = ii;
164154
let col = *col;
165-
do spawn_listener |from_rendezvous, move ii, move col| {
166-
creature(ii, col, from_rendezvous, to_rendezvous,
167-
to_rendezvous_log);
155+
let to_rendezvous = to_rendezvous.clone();
156+
let to_rendezvous_log = to_rendezvous_log.clone();
157+
let (from_rendezvous, to_creature) = stream();
158+
let from_rendezvous = Cell(from_rendezvous);
159+
do task::spawn |move ii, move col| {
160+
creature(ii, col, from_rendezvous.take(), to_rendezvous.clone(),
161+
to_rendezvous_log.clone());
168162
}
163+
to_creature
169164
});
170165
171166
let mut creatures_met = 0;
172167
173168
// set up meetings...
174169
for nn.times {
175-
let fst_creature: CreatureInfo = oldcomm::recv(from_creatures);
176-
let snd_creature: CreatureInfo = oldcomm::recv(from_creatures);
170+
let fst_creature: CreatureInfo = from_creatures.recv();
171+
let snd_creature: CreatureInfo = from_creatures.recv();
177172
178173
creatures_met += 2;
179174
180-
oldcomm::send(to_creature[fst_creature.name], Some(snd_creature));
181-
oldcomm::send(to_creature[snd_creature.name], Some(fst_creature));
175+
to_creature[fst_creature.name].send(Some(snd_creature));
176+
to_creature[snd_creature.name].send(Some(fst_creature));
182177
}
183178
184179
// tell each creature to stop
185180
for vec::eachi(to_creature) |_ii, to_one| {
186-
oldcomm::send(*to_one, None);
181+
to_one.send(None);
187182
}
188183
189184
// save each creature's meeting stats
190185
let mut report = ~[];
191186
for vec::each(to_creature) |_to_one| {
192-
report.push(oldcomm::recv(from_creatures_log));
187+
report.push(from_creatures_log.recv());
193188
}
194189
195190
// print each color in the set

src/test/bench/shootout-k-nucleotide-pipes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ fn make_sequence_processor(sz: uint, from_parent: pipes::Port<~[u8]>,
129129
_ => { ~"" }
130130
};
131131
132-
//oldcomm::send(to_parent, fmt!("yay{%u}", sz));
133132
to_parent.send(move buffer);
134133
}
135134

src/test/bench/shootout-pfib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
A parallel version of fibonacci numbers.
1515
1616
This version is meant mostly as a way of stressing and benchmarking
17-
the task system. It supports a lot of oldcommand-line arguments to
17+
the task system. It supports a lot of old command-line arguments to
1818
control how it runs.
1919
2020
*/

0 commit comments

Comments
 (0)