aboutsummaryrefslogtreecommitdiff
path: root/tests/bench/rss/a0.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 17:03:03 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 17:03:03 +0330
commit7cb983bbea98d2038b2a8015a6d1f1afd40991c9 (patch)
treeec3d88a15801207fc6d8d3c6d142617ffec85460 /tests/bench/rss/a0.zc
parentmerge work/borrow: borrow returns before definition, borrows clause, borrow m... (diff)
parentbench: rss probe path fix (diff)
merge work/actors: wasm seed bootstrap (seed/MANIFEST), shared copy-on-write actor memory, top-level hold blocks on all backends and lsp
Diffstat (limited to 'tests/bench/rss/a0.zc')
-rw-r--r--tests/bench/rss/a0.zc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/bench/rss/a0.zc b/tests/bench/rss/a0.zc
new file mode 100644
index 0000000..b8555d0
--- /dev/null
+++ b/tests/bench/rss/a0.zc
@@ -0,0 +1,11 @@
+namespace;
+include rt, actor;
+typecheck on;
+int work(int n) { rt.syscall(48, 500, 0, 0); return n + 1; }
+fn main() {
+ let n = 0, i = 0, sum = 0;
+ actor.Actor<int, int>*[101] as;
+ while (i < n) { as[i] = rt.new(actor.Actor<int, int>); as[i].spawn(work); as[i].recv(fn(int v) { sum = sum + v; return 0; }); as[i].send(i); i++; }
+ i = 0; while (i < n) { as[i].await(); as[i].close(); i++; }
+ rt.put_n(sum); rt.put_c(10); return 0;
+}