nx_parexec.nx
buildroot/runtime/nx_parexec.nx
about
nx_parexec.nx -- ACTUAL PARALLEL multi-core execution (closes distributed-compute's last blocked half).
The "1-core threading gap" was inherited, not measured: nx_syscalls has had sys_fork/sys_wait4/
sys_mmap_shared all along (hundreds of organs fork; nx_arbiter_race_gate proves shared-sink races). So
the distexec partition->merge algebra runs for REAL in parallel: the parent allocates a SHARED result
region, forks one child PER PARTITION (the kernel schedules them across cores), each child computes its
partition's partial into its OWN shared slot (disjoint writes => no locks needed), the parent wait4()s
all and merges. From the first byte up: raw fork, no pthreads, no libc, no shell. Correctness is byte-
identical to the sequential run (same algebra); the win is wall-clock, MEASURED live on the box's cores.
license_tier: ORIGINAL No hardware writes (Rule 26).
dependencies 3 imports · 1 importers
imports: nx_syscalls.nxnx_colframe.nxnx_distexec.nx
imported by: nx_parexec_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const PE_MAGIC_1103515245: i64 = 1103515245 |
| 14 | const PE_MAGIC_12345: i64 = 12345 |
| 15 | const PE_MAGIC_4242: i64 = 4242 |
| 16 | const PE_MAGIC_100000: i64 = 100000 |
| 17 | const PE_MAGIC_20000000: i64 = 20000000 |
| 19 | const PE_OUT: i64 = 8192 |
| 20 | const PE_ZERO: i64 = 48 |
| 21 | const PE_MAXP: i64 = 64 |
functions
| 24 | func pe_agg_parallel(frame: *u8, ci: i64, P: i64, out4: *i64) -> i64 |
| 74 | func pe_hash_range(frame: *u8, ci: i64, lo: i64, hi: i64) -> i64 |
| 88 | func pe_hash_parallel(frame: *u8, ci: i64, P: i64) -> i64 |
| 117 | func pe_raw(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: pe_bench |
| 118 | func pe_num(out: *u8, o: i64, v: i64) -> i64 |
| 130 | func pe_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; var go: i64 = 1; while go == 1 { let c: i64 = s[i] as i64; if c < 48 { go = 0 } else { if c > 57 { go = 0 } else { v = v * 10 + (c - 48); i = i + 1 } } } return v } called by 1: main |
| 132 | func pe_bench(nrows: i64, P: i64, out: *u8) -> i64 |
| 198 | func main(argc: i64, argv: *i64) -> i64 |