code wiki / (root) / nx_ppdemo_forkpar.nx

nx_ppdemo_forkpar.nx

buildroot/runtime/nx_ppdemo_forkpar.nx

1044 B31 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic ppdemo
docsdependenciesstructsconstsfunctions

about

nx_ppdemo_forkpar.nx -- PROCESS parallelism (fork), the axis that WORKS today (vs broken threads). Forks 8 children, each doing the SAME 3e9-iter loop nx_ppdemo_serial takes ~6.7s for, parent wait4s all. If the 8 run in parallel on 8 cores, total WALL stays ~7s (8x throughput); if it were serial it would be ~53s. Built via the sovereign lane (fork/wait4 need no func types). Time it externally. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_ppdemo_forkpar.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_fork pp_heavy sys_exit sys_mmap sys_wait4

structs

none

consts

6const K_MAGIC_3000000000: i64 = 3000000000
8const NPROC: i64 = 8

functions

10func pp_heavy() -> i64
called by 1: main
17func main() -> i64