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
223223def foo():
224224 print('Running in foo')
225225 gevent.sleep(0)
226- print('Emplict context switch to foo again')
226+ print('Explicit context switch to foo again')
227227
228228def bar():
229- print('Emplict context to bar')
229+ print('Explicit context to bar')
230230 gevent.sleep(0)
231- print('Implicit swtich switch back to bar')
231+ print('Implicit context switch back to bar')
232232
233233gevent.joinall([
234234 gevent.spawn(foo),
@@ -239,9 +239,9 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
239239< p > </ code >
240240< pre > < code class ="python ">
241241Running 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
245245</ pre > </ code > </ p >
246246< p > It is illuminating to visualize the control of the program or
247247walk through it with a debugger to see the context switches as
@@ -337,15 +337,15 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
337337Task 8 done
338338Task 9 done
339339Asynchronous:
340+ Task 1 done
340341Task 6 done
341- Task 0 done
342342Task 5 done
343343Task 3 done
344344Task 8 done
345345Task 2 done
346346Task 4 done
347347Task 7 done
348- Task 1 done
348+ Task 0 done
349349Task 9 done
350350</ pre > </ code > </ p >
351351< 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
5959def foo():
6060 print('Running in foo')
6161 gevent.sleep(0)
62- print('Emplict context switch to foo again')
62+ print('Explicit context switch to foo again')
6363
6464def bar():
65- print('Emplict context to bar')
65+ print('Explicit context to bar')
6666 gevent.sleep(0)
67- print('Implicit swtich switch back to bar')
67+ print('Implicit context switch back to bar')
6868
6969gevent.joinall([
7070 gevent.spawn(foo),
You can’t perform that action at this time.
0 commit comments