Skip to main content

Thread pool

This is a simple thread pool for python(using queue module).

Usage

  • Firstly, you should define a callback to deal with your task:

    def do_work(*args, **kwds):
        # do something
  • Then, you can create a thread pool to schedule your tasks:

    from thread_pool import ThreadPool
    
    # Create thread pool with nums threads
    pool = ThreadPool(nums)
    # Add a task into pool
    pool.add_task(do_work, args, kwds)
    # Join and destroy all threads
    pool.destroy()

Release files for thread_pool 0.9

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

Source distribution (sdist)

Source distribution for thread_pool 0.9
File Size Uploaded
thread_pool-0.9.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thread_pool 0.9
File Interpreter ABI Platform
thread_pool-0.9-py2.7.egg Legacy Egg format - - Details

Total release size: 8.3 kB

Release files / thread_pool-0.9.tar.gz

Download URL thread_pool-0.9.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e055db47643eaecf5432837cec2058173f985c600fa0ee58eb7bae58fd34a7dc
BLAKE2b-256 checksum
How to use checksums
740ca25ae9c5b9316f62ae1323ce82f6bac3d071cad713bf7c672a5805404324
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / thread_pool-0.9-py2.7.egg

Download URL thread_pool-0.9-py2.7.egg
Size 5.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
a5ab81e9577339764f47328af478e5de13e3aa141e79a9b97f7b47afaedabe2a
BLAKE2b-256 checksum
How to use checksums
bb8bd8ba7f9157c48c8375546d99dd0832de601f56f8d32691dab42b308e3739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9 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