摘要: in test g_num=[11, 22, 33] in test2 g_num=[11, 22, 33] in thread g_num=[11, 22, 33] 使用互斥锁解决资源竞争的问题 阅读全文
posted @ 2019-09-04 23:28 才华配得上梦想 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-09-04 20:18 才华配得上梦想 阅读(94) 评论(0) 推荐(0) 编辑