首页 > 代码库 > Python 多进程

Python 多进程

import threadingfrom time import sleepfrom msalt_proxy.client import Clientdef f(t):  print t  cli=Client(t,‘*‘,role=‘server‘)  cli.sys.ping()from multiprocessing import Processif __name__ == ‘__main__‘:     p = Process(target=f, args=(‘ljx2‘,))     p.start()     p.join()     p1 = Process(target=f, args=(‘ljx1,))     p1.start()     p1.join()