class documentation
Flexible thread pool class. Creates a pool of threads, then accepts tasks that will be dispatched to the next available thread.
Method | __init__ |
Initialize the thread pool with numThreads workers. |
Method | get |
Retrieve the next task from the task queue. For use only by ThreadPoolThread objects contained in the pool. |
Method | get |
@return: number of threads in the pool. |
Method | join |
Clear the task queue and terminate all pooled threads, optionally allowing the tasks and threads to finish. |
Method | queue |
Insert a task into the queue. task must be callable; args and taskCallback can be None. |
Method | remove |
Remove the marker from the currently executing tasks. Only one task with the given marker can be executed at a given time |
Method | set |
External method to set the current pool size. Acquires the resizing lock, then calls the internal version to do real work. |
Method | __set |
Set the current pool size, spawning or terminating threads if necessary. Internal use only; assumes the resizing lock is held. |
Instance Variable | __is |
Undocumented |
Instance Variable | __markers |
Undocumented |
Instance Variable | __resize |
Undocumented |
Instance Variable | __task |
Undocumented |
Instance Variable | __tasks |
Undocumented |
Instance Variable | __threads |
Undocumented |
Retrieve the next task from the task queue. For use only by ThreadPoolThread objects contained in the pool.
Clear the task queue and terminate all pooled threads, optionally allowing the tasks and threads to finish.
Remove the marker from the currently executing tasks. Only one task with the given marker can be executed at a given time
External method to set the current pool size. Acquires the resizing lock, then calls the internal version to do real work.