about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-04 19:50:45 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-04 19:50:45 -0800
commit5d4b372902da7b3234e7386e9b86cd700b434377 (patch)
tree167145482d024786dfdd550efcbbddf1e5eec5f3
parentcdb246f832a8dcecbd5305a4c256c04e1e266a0a (diff)
downloadrust-5d4b372902da7b3234e7386e9b86cd700b434377.tar.gz
rust-5d4b372902da7b3234e7386e9b86cd700b434377.zip
Revert "bench: Add threadring shootout benchmark"
This reverts commit cdb246f832a8dcecbd5305a4c256c04e1e266a0a.
-rw-r--r--src/test/bench/shootout-threadring.rs53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/test/bench/shootout-threadring.rs b/src/test/bench/shootout-threadring.rs
deleted file mode 100644
index 73f993f2728..00000000000
--- a/src/test/bench/shootout-threadring.rs
+++ /dev/null
@@ -1,53 +0,0 @@
-// Based on threadring.erlang by Jira Isa
-use std;
-
-// FIXME: Need a cleaner way to request the runtime to exit
-#[nolink]
-native mod libc {
-    fn exit(status: ctypes::c_int);
-}
-
-const n_threads: int = 503;
-
-fn start(+token: int) {
-    import iter::*;
-
-    let p = comm::port();
-    let ch = iter::foldl(bind int::range(2, n_threads + 1, _),
-                         comm::chan(p)) { |ch, i|
-        // FIXME: Some twiddling because we don't have a standard
-        // reverse range function yet
-        let id = n_threads + 2 - i;
-        let {to_child, _} = task::spawn_connected::<int, int> {|p, _ch|
-            roundtrip(id, p, ch)
-        };
-        to_child
-    };
-    comm::send(ch, token);
-    roundtrip(1, p, ch);
-}
-
-fn roundtrip(id: int, p: comm::port<int>, ch: comm::chan<int>) {
-    while (true) {
-        alt comm::recv(p) {
-          1 {
-            std::io::println(#fmt("%d\n", id));
-            libc::exit(0i32);
-          }
-          token {
-            #debug("%d %d", id, token);
-            comm::send(ch, token - 1);
-          }
-        }
-    }
-}
-
-fn main(args: [str]) {
-    let token = if vec::len(args) < 2u {
-        1000
-    } else {
-        int::from_str(args[1])
-    };
-
-    start(token);
-}
\ No newline at end of file