threading提供线程相关操作,python当前版本的多线程库没有实现优先级、线程组,线程也不能被停止、暂停、恢复和中断

  threading提供的类:

    Thread,Lock,Rlock,Condition,Semaphore,Event,Timer,local

  threading模块常用方法:

    threading.currentThread()返回当前线程句柄

    threading.enumerate()返回一个办函正在运行的线程的list

    threading.activeCount()返回正在运行的线程数量

    threading.TIMEOUT_MAX设置threading全局超时时间

2. 线程模块

  2.1 Thread

  2.2 Lock

  2.3 RLock

  2.4 Condition

  2.5 Semaphore/BoundedSemaphore

  2.6 Event

  2.7 Timer

  2.8 local

  参考:http://www.cnblogs.com/tkqasn/p/5700281.html

相关文章:

  • 2022-02-16
  • 2021-04-02
  • 2021-09-29
  • 2022-12-23
  • 2021-06-27
  • 2021-05-16
  • 2021-11-29
猜你喜欢
  • 2021-07-28
  • 2021-09-19
  • 2022-01-17
  • 2018-12-22
  • 2021-07-19
  • 2022-12-23
相关资源
相似解决方案