Skip to main content

ThreadPool library

  • Multi-threading library
  • Allows to limit the number of threads to a fixed number

Install

pip install rythreapool

Usage

  • import the library
import threadpool
  • create a new ThreadPool, giving as argument the number of desidred parallel threads
    • it is suggested to never exceed the number of physical threads that your processor has
pool = threadpool.ThreadPool(16)
  • now it is possible to run multiple functions or tasks
pool.execute(fn=myTask, args=())
  • to check if the threadpool is busy, use the following function
    • returns True if the pool is working, otherwise returns False
pool.isWorking()

Notes

  1. remember that, if a task implements active waiting, it will keep its thread busy until the end of execution
  2. once reaced the limit of parallel threads, all the following tasks will have to wait for a thread to become free

Metadata

Release files for rythreadpool 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rythreadpool 1.0.0
File Size Uploaded
rythreadpool-1.0.0.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rythreadpool 1.0.0
File Interpreter ABI Platform
rythreadpool-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.5 kB

Release files / rythreadpool-1.0.0.tar.gz

Download URL rythreadpool-1.0.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0ae3df1a3b6b8bd8c2665ee135049f3503c92f398569643d96e53606fee8fbc7
BLAKE2b-256 checksum
How to use checksums
84034fb525d47babca3e0edb267b1d5bc103ad06c6ad414338854bbfe3b00965
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.2

Release files / rythreadpool-1.0.0-py3-none-any.whl

Download URL rythreadpool-1.0.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2db7623869927f668216d58092887a4569f6557934daf80fa4c6f4e819086a29
BLAKE2b-256 checksum
How to use checksums
5f9b8dc034dc53e9931b2730bf77064817abac0df9d1695affbf3d135f667c64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page