$npx skillfedfor your agent

threadpoolctl

threadpoolctl

Worth itPyPI Python ModulesReleased Mar 2025204.2M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — threadpoolctl-3.6.0-py3-none-any.whl
v3.6.0 · released 2025-03-13 · Python >=3.9

Yes. This is a lightweight, actively maintained utility for anyone using thread-pool-backed libraries in parallel workloads. It has no dependencies, a permissive license, no known vulnerabilities, and solves a real performance problem in nested parallelism scenarios.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction installation with no runtime dependencies.
  • Active maintenance with recent releases and a stable repository.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects.

last release 2025-03-13 (519 days) · last repo commit 2026-08-11 · 431 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 204,185,238 downloads/mo, #201 on PyPI

Verify before relying

pip install threadpoolctl

from threadpoolctl import threadpool_limits

with threadpool_limits(limits=1, user_api='blas'):
    # BLAS calls limited to one thread
  • Whether all BLAS implementations (MKL, OpenBLAS, FlexiBLAS) are equally well supported across platforms.
  • Performance overhead of introspection and limit-setting operations in tight loops.
  • Compatibility with thread-pool libraries loaded after package import.
Same gist for agents: .md · .json

What it is and what it does

threadpoolctl provides Python helpers to inspect and limit the number of threads used by native thread-pool libraries (BLAS, OpenMP) that are loaded by scientific computing packages. It solves the problem of thread oversubscription—when nested parallelism causes more threads to be spawned than CPU cores, degrading performance. The package offers both a command-line interface to query loaded thread-pools and a Python API with context managers and decorators to temporarily cap thread counts in specific code sections.

It supports multiple BLAS backends and OpenMP implementations, and can be used either functionally via `threadpool_limits()` or through an object-oriented `ThreadpoolController` for more fine-grained control. The library has no runtime dependencies and supports Python 3.9 and later.

Use it for

  • Prevent thread oversubscription when calling BLAS operations inside already-parallelized code.
  • Query which thread-pool libraries are loaded by imported packages for debugging performance issues.
  • Dynamically switch BLAS backends at runtime using FlexiBLAS without restarting.
  • Decorate functions to enforce single-threaded BLAS calls while keeping outer-loop parallelism.
  • Manage thread counts in distributed pipelines with nested parallelism.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

This is a lightweight, actively maintained utility for anyone using thread-pool-backed libraries in parallel workloads. It has no dependencies, a permissive license, no known vulnerabilities, and solves a real performance problem in nested parallelism scenarios.

Install

threadpoolctl on PyPI

Before you install

Low friction installation with no runtime dependencies. Active maintenance with recent releases and a stable repository.

License in practice

BSD-3-Clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects.

Quickstart

pip install threadpoolctl

from threadpoolctl import threadpool_limits

with threadpool_limits(limits=1, user_api='blas'):
    # BLAS calls limited to one thread

Verify before relying

  • Whether all BLAS implementations (MKL, OpenBLAS, FlexiBLAS) are equally well supported across platforms.
  • Performance overhead of introspection and limit-setting operations in tight loops.
  • Compatibility with thread-pool libraries loaded after package import.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 519 days since the last release
Last repo commit
First released
Downloads204,185,238 / month, #201 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Evidence: threadpoolctl-3.6.0-py3-none-any.whl

Tags

Capabilities
thread pool controllimit threads blas openmpnested parallelism oversubscriptionthreadpool introspectioncontrol native library threadsthread limiting context managerscientific computing parallelism
Topics
parallelismperformance-tuningscientific-computing

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “limit threads blas openmp”

  • threadpoolctlInspect and control the thread-pool size of native libraries (BLAS,…
  • tcmlibManages CPU resource coordination between Intel oneAPI Threading…
  • func-timeoutRuns any Python function with a specified timeout limit, raising an…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also tcmlib · intel-openmp · onemkl-sycl-blas · onemkl-sycl-lapack · mkl-include · onemkl-sycl-sparse · onemkl-sycl-rng · mkl · onemkl-sycl-dft · onemkl-license