Skip to content

Commit ad09165

Browse files
committed
Added control flow visualization.
1 parent 0ab4e77 commit ad09165

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

flow.gif

87.7 KB
Loading

index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
242242
Emplict context switch to foo again
243243
Implicit 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
246250
bound functions which can be cooperatively scheduled. Gevent has
247251
taken care of all the details to ensure that your network
@@ -332,16 +336,16 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
332336
Task 8 done
333337
Task 9 done
334338
Asynchronous:
335-
Task 4 done
336-
Task 5 done
337-
Task 2 done
338339
Task 0 done
339-
Task 9 done
340+
Task 2 done
341+
Task 5 done
340342
Task 7 done
343+
Task 1 done
341344
Task 3 done
342345
Task 6 done
346+
Task 9 done
347+
Task 4 done
343348
Task 8 done
344-
Task 1 done
345349
</pre></code></p>
346350
<p>In the synchronous case all the tasks are run sequentially,
347351
which results in the main programming <em>blocking</em> (

tutorial.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
7480
The real power of gevent comes when we use it for network and IO
7581
bound functions which can be cooperatively scheduled. Gevent has
7682
taken care of all the details to ensure that your network

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy