Skip to content

Expose thread pool queue/running/total task counts #1044

Description

@Matt711

kvikio's thread pool is BS::thread_pool (cpp/include/kvikio/threadpool_wrapper.hpp), which already implements get_tasks_queued(), get_tasks_running(), and get_tasks_total(). Real-time utilization for the exact resource kvikio_nthreads (default 256) controls. None of it is exposed past kvikio::defaults::thread_pool() (cpp/include/kvikio/defaults.hpp). No C++ wrapper, no Python binding. python/kvikio/kvikio/_lib/defaults.pyx only exposes get/set for thread_pool_nthreads.

Add a thin C++ wrapper and a .pyx binding.

Why it matters: today the only signal is kvikio.Summary, a post-hoc aggregate over the whole query. It can't tell apart a saturated pool (raising thread count would help) from a pool with spare capacity (raising thread count won't help, the real constraint is upstream). A kvikio_nthreads sweep that shows no improvement is ambiguous between those two cases without a live queued/running count. This is also how we'd tell whether max_concurrent_io_tasks or kvikio_nthreads is actually the one binding for a given regression, instead of guessing which layer to tune.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions