摘要: 一提到多线程一般大家的第一感觉就是可以提升程序性能,在实际的操作中往往遇到性能的问题,都尝试使用多线程来解决问题,但多线程程序并不是在任何情况下都能提升效率,在一些情况下恰恰相反,反而会降低程序的性能。这里给出两个简单的例子来说明下:程序1:View Code import threadingfrom time import ctimeclass MyThread(threading.Thread): def __init__(self, func, args, name): threading.Thread.__init__(self) self.name ... 阅读全文
posted @ 2012-12-08 11:57 平凡之路 阅读(17273) 评论(7) 推荐(2) 编辑