无意中发现一个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:方法参数
具体的参阅上面地址
版权声明:自由转载-非商用-非衍生-保持署名
comments powered by Disqus