Files
aji/tests/conformance/source/modules/task_lend.aji
T
dev c96199e7ec cli: add explicit package source modules
Link manifest-selected source graphs with module-local names, qualified
structs/enums/functions and task workers through ordinary AIR verification.
Keep source inputs bounded, reject source symlinks and preserve explicit
grants, diagnostics and deterministic canonical lowering.

Integrate spec 12/15, RFC 0021, source reference budgets, roadmap, examples
and CI coverage. Validate 579 conformance tests, unit tests, 76 source
constructs, hosted smoke, 36 package CLI checks and task schedule stress.
2026-10-06 18:51:54 +03:00

32 lines
768 B
Rust

// Two tasks square the two halves of one buffer; the halves are lent until the joins.
// expect: run
// result: [1,4,9,16]
// equivalent: phase3/run/tasks_parallel_square.air
// schedules: 8
// module: app.workers=source/modules/workers.aji.inc
// phase: 6
// spec: docs/spec/15-source-language.md
module app.entry
import app.workers;
fn main() -> [u64; 4]
effects [task.spawn]
{
var buf: [u64; 4] = zero;
buf[0] = 1;
buf[1] = 2;
buf[2] = 3;
buf[3] = 4;
{
mut s = buf;
let (l, r) = s.split_at(2);
scope sc {
let t1 = task.spawn(sc, app.workers.square, l);
let t2 = task.spawn(sc, app.workers.square, r);
task.join(move t1);
task.join(move t2);
}
}
buf
}