File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,6 +242,10 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
242242Emplict context switch to foo again
243243Implicit swtich switch back to bar
244244</ pre > </ code > </ p >
245+ < p > It is illuminating to visualize the control of the program or
246+ walk through it with a debugger to see the context switches as
247+ they occur.</ p >
248+ < p > < img alt ="Greenlet Control Flow " src ="flow.gif " /> </ p >
245249< p > The real power of gevent comes when we use it for network and IO
246250bound functions which can be cooperatively scheduled. Gevent has
247251taken care of all the details to ensure that your network
@@ -332,16 +336,16 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
332336Task 8 done
333337Task 9 done
334338Asynchronous:
335- Task 4 done
336- Task 5 done
337- Task 2 done
338339Task 0 done
339- Task 9 done
340+ Task 2 done
341+ Task 5 done
340342Task 7 done
343+ Task 1 done
341344Task 3 done
342345Task 6 done
346+ Task 9 done
347+ Task 4 done
343348Task 8 done
344- Task 1 done
345349</ pre > </ code > </ p >
346350< p > In the synchronous case all the tasks are run sequentially,
347351which results in the main programming < em > blocking</ em > (
Original file line number Diff line number Diff line change @@ -71,6 +71,12 @@ gevent.joinall([
7171]]]
7272[[[ end]]]
7373
74+ It is illuminating to visualize the control of the program or
75+ walk through it with a debugger to see the context switches as
76+ they occur.
77+
78+ ![ Greenlet Control Flow] ( flow.gif )
79+
7480The real power of gevent comes when we use it for network and IO
7581bound functions which can be cooperatively scheduled. Gevent has
7682taken care of all the details to ensure that your network
You can’t perform that action at this time.
0 commit comments