code wiki / (root) / nx_ppdemo_parallel.nx

nx_ppdemo_parallel.nx

buildroot/runtime/nx_ppdemo_parallel.nx

1142 B29 linesdepth 7pulls 9 transitivereach 0 importersview sourcekind tooltopic ppdemo
docsdependenciesstructsconstsfunctions

about

nx_ppdemo_parallel.nx -- a controlled MULTI-THREADED compute workload: the SAME arithmetic loop as nx_ppdemo_serial, but split across a thread pool (8 real OS threads). nx_parallelism_probe should measure cpu/wall ~= 8 (eight cores busy at once) and verdict PARALLEL -- the opposite of the single-threaded serial demo, proving the probe distinguishes real parallelism from the codec trap. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_thread_pool.nx nx_ppdemo_parallel.nx

imports: nx_syscalls.nxnx_thread_pool.nx

imported by: nobody (leaf or entry point)

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

main nx_pool_new nx_hw_worker_count nx_hw_cpu_count sys_mmap sys_munmap sys_mmap ↻ nx_chan_new sys_mmap ↻ _nx_chan_cell sys_thread_create nx_thread_spawn sys_mmap ↻ nx_thread_spawn_fn sys_mmap ↻ nx_pool_submit nx_atom_faa_i64 nx_chan_send nx_chan_try_send _nx_chan_cell ↻ nx_thread_yield _pool_futex_wake_all sys_futex_wake nx_pool_wait nx_atom_load_i64 nx_thread_yield ↻ nx_atom_store_i64 _pool_futex_wait sys_futex_wait nx_pool_shutdown nx_atom_faa_i64 ↻ nx_chan_send ↻ _pool_futex_wake_all ↻ nx_atom_load_i64 ↻ nx_thread_yield ↻ sys_exit

structs

none

consts

7const K_MAGIC_500000000: i64 = 500000000
9const NW: i64 = 8 // worker threads (of the 16 cores; 8 keeps room for the pool machinery)

functions

12func pp_heavy(ctx: i64) -> i64
22func main() -> i64