摘要:
服务器端: 阅读全文
摘要:
from urllib import requestimport gevent,timefrom gevent import monkeymonkey.patch_all() def f(url): print('GET: %s' % url) resp = request.urlopen(url) 阅读全文
摘要:
import geventdef f1(): print("print in f1") gevent.sleep(2) print("switch to foo again")def f2(): print("print in f2") gevent.sleep(1) print("switch t 阅读全文
摘要:
/var/log/message :系统日志信息 [root@xiesongyou log]# tail -1 messagesOct 25 09:18:46 xiesongyou dhclient[906]: bound to 192.168.154.129 -- renewal in 738 s 阅读全文
摘要:
from greenlet import greenletdef test1(): print("a") gr2.switch() print("b") gr2.switch()def test2(): print("c") gr1.switch() print("d") gr1 = greenle 阅读全文
摘要:
from multiprocessing import Process,Poolimport time,osdef Foo(i): time.sleep(2) print("in the Proess ",os.getpid()) return idef Bar(arg): print("-->ex 阅读全文
摘要:
from multiprocessing import Process,Lockdef run_lock(l,i): l.acquire() print("Hello ",i) l.release()l=Lock()if __name__=="__main__": for i in range(10 阅读全文