Python 2.x frameworks doesn’t come with any thread pool by default but an handy library is provided by Chris A. You can anyway easily install it with
pip install threadpool on any OS which supports pip.
You can read more about threadpool library at this address:
Here below you can have a look at how to use it in a simple way.
from threadpool import ThreadPool, makeRequests
“””thread worker function”””
print ‘Worker start’
for x in xrange(10000000):
print ‘Worker stop’
requests = makeRequests(worker, data)
[pool.putRequest(req) for req in requests]
print “all thread finished”
# wait for 1s would be enough to get threads cleaned