Multi-threading library
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rythreadpool-1.0.0.tar.gz
(14.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rythreadpool-1.0.0.tar.gz.
File metadata
- Download URL: rythreadpool-1.0.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ae3df1a3b6b8bd8c2665ee135049f3503c92f398569643d96e53606fee8fbc7
|
|
| MD5 |
c57ad46556cc24f7987872c0a1786d01
|
|
| BLAKE2b-256 |
84034fb525d47babca3e0edb267b1d5bc103ad06c6ad414338854bbfe3b00965
|
File details
Details for the file rythreadpool-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rythreadpool-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2db7623869927f668216d58092887a4569f6557934daf80fa4c6f4e819086a29
|
|
| MD5 |
59eeb4aeb9f1f1b456b3df1ba64e05c3
|
|
| BLAKE2b-256 |
5f9b8dc034dc53e9931b2730bf77064817abac0df9d1695affbf3d135f667c64
|