首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Python > Python线程池的实现

Python线程池的实现

  • 资源大小:12.99 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: python 线程 实现

资 源 简 介

ThreadPool Component The ThreadPool is a component in which other components can get jobs executed. The API has three important functions: ThreadPool(max_workers=5, kill_workers_after=3) Constructor function * max_workers is the maximum number of threads used in/by the pool. * kill_workers_after is the number of seconds a worker should wait for jobs before being killed add_job(function, args=None, return_callback=None) function is the callable that defines the job args is a list of arguments to the function return_callback is called when the function has been performed. shutdown(wait_for_workers_period = 1, clean_shutdown_reties = 5) Blocks so no more jobs are accepted. Waits for all workers to punch out. When a call to this function returns the program can be terminated. * wait_for_workers_period is the number of seconds to wait for workers to shutdown * clean_shutdown_ret

文 件 列 表

Tests
.svn
__init__.py
TestTiming.py
ThreadingXmlRpcServer.py
ThreadPoolXmlRpcServer.py
XmlRpcTest.py
ThreadPool
.svn
__init__.py
ThreadPool.py
VIP VIP
0.214267s