Module Expr Str Assign NameStore Str Import alias alias alias ClassDef bases NameLoad body Assign NameStore ListLoad FunctionDef arguments args NameParam NameParam NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Num TryFinally body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr For NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AugAssignAdd NameStore Num If CompareEq NameLoad NameLoad body Break finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr If BoolOpAnd CompareEq NameLoad Num CompareLt Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryFinally body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index Call NameLoad NameLoad Call AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body For NameStore AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryFinally body Delete SubscriptDel AttributeLoad NameLoad attr Slice For NameStore AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Call NameLoad NameLoad attr finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryFinally body Assign NameStore CompareEq Call NameLoad AttributeLoad NameLoad attr Num For NameStore AttributeLoad NameLoad attr body Assign NameStore BoolOpAnd NameLoad AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body While NameLoad body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Return If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd UnaryOpNot Call AttributeLoad NameLoad attr CompareNotEq AttributeLoad NameLoad attr NameLoad body If Call AttributeLoad NameLoad attr body Return Continue Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Num Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr TryFinally body Assign AttributeStore NameLoad attr NameLoad If CompareIn Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Call NameLoad NameLoad attr Delete SubscriptDel AttributeLoad NameLoad attr Index Call NameLoad NameLoad If CompareIn NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad finalbody Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list decorator_list FunctionDef arguments args defaults body Import alias Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Import alias For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr If CompareEq NameLoad AttributeLoad NameLoad attr body Raise NameLoad If CompareEq NameLoad AttributeLoad NameLoad attr body Raise NameLoad decorator_list FunctionDef arguments args defaults body Import alias Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Import alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Print Str NameLoad Expr Call AttributeLoad NameLoad attr Num Print Str NameLoad decorator_list decorator_list Assign NameStore Call NameLoad NameLoad Print Str Expr ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr Print Str For NameStore Call NameLoad Num body Print Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod NameLoad Num For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr
N/A N/A 
This module implements a threadpool which allows scripts that require
performing concurrent jobs, an efficient and thread safe way to do this.

The two classes available are ThreadPool and Thread. ThreadPool is the
controller class and contains a collection of Thread objects, which must be
subclassed.
Any thread can add a job to the ThreadPool by calling its append() method.
The pool will add this task to the jobqueue and activate a sleeping thread, if
available. In case no thread is directly available, the job will be handled by
the first free thread.

The Thread class must be subclassed and passed to the ThreadPool's constructor.
The subclass should implement a do(args) method, which will receive as its
argument the job. Please note that providing mutable variables to the jobqueue
may cause thread unsafety!
 N/A __version__ $Id: 167d71a1d625b72daa7519e2b63933b1aba92b76 $ N/A sys threading os ThreadPool N/A dict N/A N/A pools N/A __init__ N/A N/A self worker max_threads N/A args kwargs N/A N/A N/A N/A dict __init__ self N/A N/A self jobLock N/A N/A threading Lock N/A N/A self jobQueue N/A N/A N/A self worker worker N/A N/A self threads N/A N/A N/A self max_threads max_threads N/A N/A self args args N/A N/A self kwargs kwargs N/A N/A N/A N/A self pools append self N/A append N/A N/A self job N/A N/A N/A N/A N/A N/A self jobLock acquire N/A counter 0 N/A N/A N/A N/A N/A N/A self jobQueue append job N/A unlock_workers N/A len N/A self jobQueue N/A event N/A N/A self itervalues N/A N/A N/A N/A N/A event isSet N/A N/A N/A N/A event set N/A counter 1 N/A N/A counter unlock_workers N/A N/A N/A N/A N/A N/A N/A self jobLock release N/A N/A N/A counter 0 N/A N/A len N/A self threads N/A self max_threads N/A N/A N/A N/A self add_thread N/A N/A N/A self start N/A add_thread N/A N/A self N/A N/A N/A N/A N/A N/A self jobLock acquire N/A N/A N/A thread N/A N/A self worker self N/A self args N/A self kwargs N/A N/A N/A N/A self threads append thread N/A N/A self N/A N/A id thread N/A N/A threading Event N/A N/A N/A N/A N/A self jobLock release N/A start N/A N/A self N/A N/A N/A thread N/A self threads N/A N/A N/A N/A N/A thread isAlive N/A N/A N/A N/A thread start N/A exit N/A N/A self N/A N/A N/A N/A N/A N/A self jobLock acquire N/A N/A N/A N/A N/A self jobQueue N/A N/A thread N/A self threads N/A N/A N/A thread quit True N/A N/A N/A N/A self N/A N/A id thread set N/A N/A N/A N/A N/A self jobLock release N/A is_idle N/A N/A self N/A N/A N/A N/A N/A N/A self jobLock acquire N/A N/A N/A idle N/A N/A len N/A self jobQueue 0 N/A thread N/A self threads N/A N/A idle N/A idle N/A thread is_idle N/A N/A N/A N/A N/A self jobLock release N/A idle N/A N/A Thread N/A N/A threading Thread N/A N/A timeout None __init__ N/A N/A self pool N/A N/A N/A N/A N/A N/A threading Thread __init__ self N/A N/A self pool pool N/A N/A self quit False N/A N/A self is_idle True N/A run N/A N/A self N/A N/A N/A True N/A N/A N/A N/A N/A N/A self pool jobLock acquire N/A N/A N/A self quit N/A N/A N/A self pool jobQueue N/A N/A N/A N/A N/A N/A self pool jobLock release N/A N/A N/A N/A N/A self pool jobQueue N/A N/A event N/A N/A self pool N/A N/A id self N/A N/A N/A N/A N/A self pool jobLock release N/A N/A N/A event clear N/A N/A N/A event wait N/A self timeout N/A N/A N/A N/A N/A event isSet N/A N/A self timeout None N/A N/A N/A N/A self starve N/A N/A N/A N/A job N/A N/A N/A N/A self pool jobQueue pop 0 N/A N/A self is_idle False N/A N/A N/A N/A N/A self pool jobLock release N/A N/A N/A self do job N/A N/A self is_idle True N/A exit N/A N/A self N/A N/A N/A N/A N/A N/A N/A self pool jobLock acquire N/A N/A N/A N/A self quit True N/A N/A N/A id self N/A self pool N/A N/A N/A N/A N/A N/A self pool N/A N/A id self set N/A N/A N/A self pool N/A N/A id self N/A N/A self N/A N/A self pool threads N/A N/A N/A N/A N/A N/A self pool threads remove self N/A N/A N/A N/A N/A N/A self pool jobLock release N/A starve N/A N/A self N/A N/A N/A N/A N/A catch_signals N/A N/A N/A N/A N/A signal N/A N/A N/A signal signal N/A signal SIGINT sig_handler N/A N/A N/A signal signal N/A signal SIGTERM sig_handler N/A sig_handler N/A N/A signalnum stack N/A N/A N/A signal N/A pool N/A ThreadPool pools N/A N/A N/A N/A pool exit N/A N/A signalnum N/A signal SIGINT N/A N/A KeyboardInterrupt N/A N/A signalnum N/A signal SIGTERM N/A N/A SystemExit N/A terminate N/A N/A N/A N/A N/A signal N/A N/A N/A os kill 0 N/A signal SIGTERM N/A N/A N/A __name__ __main__ N/A N/A time Worker N/A Thread N/A do N/A N/A self args N/A N/A N/A Working self N/A N/A N/A time sleep 10 N/A Done self N/A N/A N/A pool N/A ThreadPool Worker N/A Spawning 5 threads N/A N/A N/A N/A pool add_thread N/A i N/A xrange 5 N/A N/A N/A pool start N/A Doing 25 jobs N/A i N/A xrange 25 N/A N/A Job i N/A N/A N/A pool append i N/A N/A N/A time sleep N/A i 6 N/A thread N/A pool threads N/A N/A N/A N/A thread exit