code wiki / (root) / nx_thread_pool_test.nx

nx_thread_pool_test.nx

buildroot/runtime/nx_thread_pool_test.nx

3083 B84 linesdepth 7pulls 15 transitivereach 0 importersview sourcekind gate/prooftopic thread
docsdependenciesstructsconstsfunctions

about

nx_thread_pool_test.nx -- end-to-end pool stress. Submit TOTAL_TASKS tasks each bumping a shared atomic counter; wait for completion; verify counter == TOTAL_TASKS exactly. Two passes: T1: small pool (hw workers) + many tasks; verifies fan-out T2: re-use the same pool for another batch; verifies pool liveness across multiple submit waves

dependencies 6 imports · 0 importers

nx_kernel_v2.nx nx_log.nx nx_atom.nx nx_thread.nx nx_thread_pool.nx nx_hw.nx nx_thread_pool_test.nx

imports: nx_kernel_v2.nxnx_log.nxnx_atom.nxnx_thread.nxnx_thread_pool.nxnx_hw.nx

imported by: nobody (leaf or entry point)

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

main nx_hw_worker_count nx_hw_cpu_count sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_munmap println sys_write ↻ strlen sys_mmap ↻ nx_pool_new nx_hw_worker_count ↻ 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_n_alive nx_atom_load_i64 nx_pool_submit _nx_pool_submit_raw nx_atom_faa_i64 nx_chan_send

structs

none

consts

17const TOTAL_TASKS_PER_WAVE: i64 = 500

functions

21func bump_counter_task(ctx: i64) -> i64
calls 1: nx_atom_faa_i64
27func main() -> nx_exit