摘要: 线程安全性问题# 多线程环境下 肯定不可以变为单线程# 共享变量 不可以# 并发对共享变量进行修改 可以 import threadingclass MyThread(threading.Thread): sum = 0 # 锁 lock = threading.Lock() def run(sel 阅读全文
posted @ 2022-07-01 13:57 故y 阅读(25) 评论(0) 推荐(0)
摘要: import threadingclass MyThreading(threading.Thread): def run(self): print("Hello,world!")my_threading = MyThreading()my_threading2 = MyThreading()my_t 阅读全文
posted @ 2022-07-01 13:47 故y 阅读(26) 评论(0) 推荐(0)