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
Trueif the pool is working, otherwise returnsFalse
- returns
pool.isWorking()
Notes
- remember that, if a task implements active waiting, it will keep its thread busy until the end of execution
- 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)
| File | Size | Uploaded | |
|---|---|---|---|
| rythreadpool-1.0.0.tar.gz | 14.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|