diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/t1801.check | 11 | ||||
-rw-r--r-- | test/files/jvm/t1801.scala | 31 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/files/jvm/t1801.check b/test/files/jvm/t1801.check new file mode 100644 index 0000000000..ffe06fd5bc --- /dev/null +++ b/test/files/jvm/t1801.check @@ -0,0 +1,11 @@ +0 +100 +200 +300 +400 +500 +600 +700 +800 +900 +done! diff --git a/test/files/jvm/t1801.scala b/test/files/jvm/t1801.scala new file mode 100644 index 0000000000..4b11732258 --- /dev/null +++ b/test/files/jvm/t1801.scala @@ -0,0 +1,31 @@ +import scala.actors.Actor._ + +object Test { + val rt = Runtime.getRuntime() + val sender = actor { + var cnt = 0 + while(cnt < 1000) { + if ((cnt % 100) == 0) println(cnt) + receiver ! new Array[Int] (1048576) + cnt += 1 + //println ("Used Mem: " + (((rt.totalMemory() - rt.freeMemory()) / 1048576.) formatted "%.2f") + " Mb") + } + receiver ! 'exit + } + + val receiver = actor { + loop { + react { + case x: Array[Int] => ()//println ("received " + x.length) + case 'exit => { + println("done!") + exit() + } + } + } + } + + def main (args: Array[String]) { + sender + } +} |