定义函数
导入微线程:
import stackless
结果:
hello
heoooo
结果:
heoooo
def h():
print "hello"
def h2():
print "heoooo"
导入微线程:
import stackless
#指定任务
t1=stackless.tasklet(h)()
t2=stackless.tasklet(h2)()
t1.run()
结果:
hello
heoooo
#指定任务
t1=stackless.tasklet(h)()
t2=stackless.tasklet(h2)()
t2.run()
结果:
heoooo