File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -223,12 +223,12 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
223
223
def foo():
224
224
print('Running in foo')
225
225
gevent.sleep(0)
226
- print('Emplict context switch to foo again')
226
+ print('Explicit context switch to foo again')
227
227
228
228
def bar():
229
- print('Emplict context to bar')
229
+ print('Explicit context to bar')
230
230
gevent.sleep(0)
231
- print('Implicit swtich switch back to bar')
231
+ print('Implicit context switch back to bar')
232
232
233
233
gevent.joinall([
234
234
gevent.spawn(foo),
@@ -239,9 +239,9 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
239
239
< p > </ code >
240
240
< pre > < code class ="python ">
241
241
Running in foo
242
- Emplict context to bar
243
- Emplict context switch to foo again
244
- Implicit swtich switch back to bar
242
+ Explicit context to bar
243
+ Explicit context switch to foo again
244
+ Implicit context switch back to bar
245
245
</ pre > </ code > </ p >
246
246
< p > It is illuminating to visualize the control of the program or
247
247
walk through it with a debugger to see the context switches as
@@ -337,15 +337,15 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
337
337
Task 8 done
338
338
Task 9 done
339
339
Asynchronous:
340
+ Task 1 done
340
341
Task 6 done
341
- Task 0 done
342
342
Task 5 done
343
343
Task 3 done
344
344
Task 8 done
345
345
Task 2 done
346
346
Task 4 done
347
347
Task 7 done
348
- Task 1 done
348
+ Task 0 done
349
349
Task 9 done
350
350
</ pre > </ code > </ p >
351
351
< p > In the synchronous case all the tasks are run sequentially,
Original file line number Diff line number Diff line change @@ -59,12 +59,12 @@ import gevent
59
59
def foo():
60
60
print('Running in foo')
61
61
gevent.sleep(0)
62
- print('Emplict context switch to foo again')
62
+ print('Explicit context switch to foo again')
63
63
64
64
def bar():
65
- print('Emplict context to bar')
65
+ print('Explicit context to bar')
66
66
gevent.sleep(0)
67
- print('Implicit swtich switch back to bar')
67
+ print('Implicit context switch back to bar')
68
68
69
69
gevent.joinall([
70
70
gevent.spawn(foo),
You can’t perform that action at this time.
0 commit comments