摘要:
in test g_num=[11, 22, 33] in test2 g_num=[11, 22, 33] in thread g_num=[11, 22, 33] 使用互斥锁解决资源竞争的问题 阅读全文
摘要:
import threading import time def test1(): for i in range(5): print(" test1 %d" % i) time.sleep(1) # 如果创建Thread时执行的函数,运行结束,意味着这个子线程结束了 def test2(): for i in range(10): print(" test2 %d" % i) time.sleep 阅读全文