code wiki / (root) / nx_thread_pool_test.nx

nx_thread_pool_test.nx

buildroot/runtime/nx_thread_pool_test.nx

3083 B84 linesdepth 7pulls 14 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 sys_munmap 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_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_atom_load_i64 ↻ nx_pool_shutdown nx_atom_faa_i64 ↻ nx_chan_send ↻ _pool_futex_wake_all ↻ nx_atom_load_i64 ↻ nx_thread_yield ↻

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