摘要:
1 from gevent import monkey,spawn;monkey.patch_all() 2 from threading import current_thread 3 import time 4 # 实现了单线程下的并发,遇到i/O就切换 5 def eat(): 6 print 阅读全文
posted @ 2018-07-17 20:21
Roc_Atlantis
阅读(282)
评论(0)
推荐(0)
摘要:
1.定时器 指定n秒后,执行任务 1 from threading import Timer,current_thread 2 import os 3 4 5 def hello(): 6 print("%s hello, world"%os.getpid()) 7 print("%s hello, 阅读全文
posted @ 2018-07-17 14:21
Roc_Atlantis
阅读(429)
评论(0)
推荐(0)
浙公网安备 33010602011771号