发布时间:2019-09-18 07:27:52编辑:auto阅读(2417)
import threading
import time
sem=threading.Semaphore(4) #限制线程的最大数量为4个
def gothread():
with sem: #锁定线程的最大数量
for i in range(8):
print(threading.current_thread().name,i)
time.sleep(1)
for i in range(5):
threading.Thread(target=gothread).start()
上一篇: jmeter调用python脚本 入
下一篇: Python 串口编程 AT指令控制短信
50958
50341
40956
37825
32289
29179
28067
22896
22858
21191
1050°
1728°
1410°
1348°
1609°
1438°
2094°
3636°
3562°
2510°