Published

日 22 九月 2013

←Home

python多线程模块Threadpool

无意中发现一个python的第三方多线程模块threadpool

地址是 :http://chrisarndt.de/projects/threadpool/

例子不难看懂:

pool = ThreadPool(poolsize)
requests = makeRequests(some_callable, list_of_args, callback)
[pool.putRequest(req) for req in requests]
pool.wait()

poolsize:线程数 some_callable:可调方法 list_of_args:方法参数

具体的参阅上面地址

Go Top
comments powered by Disqus