import gevent def f(n): for i in range(n): print (gevent.getcurrent(), i) # gevent.getcurrent() 获取当前进程 g1 = gevent.spawn(f, 3)#函数名,数目 g2 = gevent.spawn(f, 4) g3 = gevent.spawn(f, 5) g1.join() g2.join() g3.join() import gevent def f(n): for i in range…