Python 多线程

来源:互联网 发布:cadence软件介绍 编辑:程序博客网 时间:2024/06/07 23:06
        all_nums=len(objs)        pox=all_nums/10        max=0        threads=[]        for thread_i in range(1,12):                min = max                max = min + pox                if thread_i==11:max=all_nums                db_no=str(thread_i).zfill(2)                t = threading.Thread(target=commit_objs,args=(write_engine,objs,tbname,min,max,thread_i))                threads.append(t)        for t in threads:                t.setDaemon(True)                t.start()        for t in threads:                t.join()