摘要:
多个线程同时操作一个数据的时候,需要加上锁例子import threadingcount = 0lock = threading.Lock()def add_data(): print("当前的线程是",threading.currentThread()) global count # lock.a 阅读全文
posted @ 2021-07-09 01:11
candy耶
阅读(57)
评论(0)
推荐(0)
摘要:
线程 程序的最小的执行单位 py文件就是一个进程,这个进程里面本来就是有一个线程的,本来的这个线程,就叫做主线程 线程和线程之间是独立的。锁 多个线程同时操作同一个数据的时候例子: import threadingimport time,randomdef create_data(url): t = 阅读全文
posted @ 2021-07-09 01:09
candy耶
阅读(87)
评论(0)
推荐(0)

浙公网安备 33010602011771号