摘要: threading:基于对象和类的较高层面上的接口,threading模块在内部使用_thread模块来实现线程的对象以及常用的同步化工具的功能。 使用定制类的方式继承 threading.Thread基类 1. 在子类中需要override __init__ 和 run() 方法。 2. 当创建这 阅读全文
posted @ 2016-12-20 22:36 someOneHan 阅读(307) 评论(0) 推荐(0) 编辑
摘要: python 线程之_thread _thread module: 基本用法: 1 def child(tid): 2 print("hello from child",tid) 3 _thread.start_new_thread(child,(1,) 1 使用_thread.start_new_ 阅读全文
posted @ 2016-12-20 21:43 someOneHan 阅读(238) 评论(0) 推荐(0) 编辑