标签:cells keyword lin print body space fun 高并发 cin
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
from greenlet import greenletdef test1(): print(12) gr2.switch() print(34) gr2.switch()def test2(): print(56) gr1.switch() print(78)gr1 = greenlet(test1)#启动一个协程gr2 = greenlet(test2)#启动一个协程gr1.switch()#switch是协程切换 |
高并发,单线程的实现上万并发不是问题
标签:cells keyword lin print body space fun 高并发 cin
原文地址:https://www.cnblogs.com/394510636-ff/p/9282139.html