@@ -192,7 +192,8 @@ <h3 id="contributors">Contributors</h3>
192
192
< a href ="https://github.com/traviscline "> Travis Cline</ a >
193
193
< a href ="https://github.com/Lothiraldan "> Boris Feld</ a >
194
194
< a href ="https://github.com/youngsterxyf "> youngsterxyf</ a >
195
- < a href ="https://github.com/ehebert "> Eddie Hebert</ a > </ p >
195
+ < a href ="https://github.com/ehebert "> Eddie Hebert</ a >
196
+ < a href ="http://notmyidea.org "> Alexis Metaireau</ a > </ p >
196
197
< p > This is a collaborative document published under MIT license.
197
198
Have something to add? See a typo? Fork and issue a
198
199
pull request < a href ="https://github.com/sdiehl/gevent-tutorial "> Github</ a > .
@@ -212,7 +213,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
212
213
depend on the other tasks and thus can be run
213
214
< em > asynchronously</ em > instead of one at a time
214
215
< em > synchronously</ em > . A switch between the two
215
- executions is known as a < em > context swtich </ em > .</ p >
216
+ executions is known as a < em > context switch </ em > .</ p >
216
217
< p > A context switch in gevent done through
217
218
< em > yielding</ em > . In this case example we have
218
219
two contexts which yield to each other through invoking
@@ -250,7 +251,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
250
251
< p > The real power of gevent comes when we use it for network and IO
251
252
bound functions which can be cooperatively scheduled. Gevent has
252
253
taken care of all the details to ensure that your network
253
- libraries will implictly yield their greenlet contexts whenever
254
+ libraries will implicitly yield their greenlet contexts whenever
254
255
possible. I cannot stress enough what a powerful idiom this is.
255
256
But maybe an example will illustrate.</ p >
256
257
< pre > < code class ="python ">
@@ -337,16 +338,16 @@ <h2 id="synchronous-asynchronous-execution">Synchronous & Asynchronous Execu
337
338
Task 8 done
338
339
Task 9 done
339
340
Asynchronous:
340
- Task 1 done
341
+ Task 2 done
341
342
Task 6 done
342
- Task 5 done
343
- Task 3 done
344
343
Task 8 done
345
- Task 2 done
344
+ Task 3 done
346
345
Task 4 done
347
346
Task 7 done
348
- Task 0 done
347
+ Task 1 done
349
348
Task 9 done
349
+ Task 0 done
350
+ Task 5 done
350
351
</ pre > </ code > </ p >
351
352
< p > In the synchronous case all the tasks are run sequentially,
352
353
which results in the main programming < em > blocking</ em > (
@@ -449,7 +450,7 @@ <h2 id="determinism">Determinism</h2>
449
450
</ pre >
450
451
451
452
< p > Even though gevent is normally deterministic, sources of
452
- non-determinism can creep into your program when you beging to
453
+ non-determinism can creep into your program when you begin to
453
454
interact with outside services such as sockets and files. Thus
454
455
even though green threads are a form of "deterministic
455
456
concurrency", they still can experience some of the same problems
@@ -485,7 +486,7 @@ <h2 id="spawning-threads">Spawning Threads</h2>
485
486
thread1 = Greenlet.spawn(foo, "Hello", 1)
486
487
487
488
# Wrapper for creating and runing a new Greenlet from the named
488
- # function foo, with the passd arguments
489
+ # function foo, with the passed arguments
489
490
thread2 = gevent.spawn(foo, "I live!", 2)
490
491
491
492
# Lambda expressions
@@ -528,8 +529,8 @@ <h2 id="spawning-threads">Spawning Threads</h2>
528
529
Hi there!
529
530
</ pre > </ code > </ p >
530
531
< h2 id ="greenlet-state "> Greenlet State</ h2 >
531
- < p > Like any other segement of code Greenlets can fail in various
532
- ways. A greenlet may fail throw an exception, fail to halt or
532
+ < p > Like any other segment of code, Greenlets can fail in various
533
+ ways. A greenlet may fail to throw an exception, fail to halt or
533
534
consume too many system resources.</ p > </ p >
534
535
< p > The internal state of a greenlet is generally a time-dependent
535
536
parameter. There are a number of flags on greenlets which let
0 commit comments