安装 libevent
apt-get install libevent-dev
安装python-dev
apt-get install python-dev
安装greenlet
easy_install greenlet
安装gevent
easy_install gevent
一个小测试
测试gevent 的任务池
from gevent import pool |
g = pool.Pool() |
def a(): |
for i in xrange ( 100 ): |
g.spawn(b) |
def b(): |
print 'b' |
g.spawn(a) |
g.join() |