Skip to content

Commit 6be4396

Browse files
committed
Fixed a few typos.
1 parent fee15b9 commit 6be4396

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

index.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ <h3 id="contributors">Contributors</h3>
192192
<a href="https://github.com/traviscline">Travis Cline</a>
193193
<a href="https://github.com/Lothiraldan">Boris Feld</a>
194194
<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>
196197
<p>This is a collaborative document published under MIT license.
197198
Have something to add? See a typo? Fork and issue a
198199
pull request <a href="https://github.com/sdiehl/gevent-tutorial">Github</a>.
@@ -212,7 +213,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
212213
depend on the other tasks and thus can be run
213214
<em>asynchronously</em> instead of one at a time
214215
<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>
216217
<p>A context switch in gevent done through
217218
<em>yielding</em>. In this case example we have
218219
two contexts which yield to each other through invoking
@@ -250,7 +251,7 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
250251
<p>The real power of gevent comes when we use it for network and IO
251252
bound functions which can be cooperatively scheduled. Gevent has
252253
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
254255
possible. I cannot stress enough what a powerful idiom this is.
255256
But maybe an example will illustrate.</p>
256257
<pre><code class="python">
@@ -337,16 +338,16 @@ <h2 id="synchronous-asynchronous-execution">Synchronous &amp; Asynchronous Execu
337338
Task 8 done
338339
Task 9 done
339340
Asynchronous:
340-
Task 1 done
341+
Task 2 done
341342
Task 6 done
342-
Task 5 done
343-
Task 3 done
344343
Task 8 done
345-
Task 2 done
344+
Task 3 done
346345
Task 4 done
347346
Task 7 done
348-
Task 0 done
347+
Task 1 done
349348
Task 9 done
349+
Task 0 done
350+
Task 5 done
350351
</pre></code></p>
351352
<p>In the synchronous case all the tasks are run sequentially,
352353
which results in the main programming <em>blocking</em> (
@@ -449,7 +450,7 @@ <h2 id="determinism">Determinism</h2>
449450
</pre>
450451

451452
<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
453454
interact with outside services such as sockets and files. Thus
454455
even though green threads are a form of "deterministic
455456
concurrency", they still can experience some of the same problems
@@ -485,7 +486,7 @@ <h2 id="spawning-threads">Spawning Threads</h2>
485486
thread1 = Greenlet.spawn(foo, "Hello", 1)
486487

487488
# 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
489490
thread2 = gevent.spawn(foo, "I live!", 2)
490491

491492
# Lambda expressions
@@ -528,8 +529,8 @@ <h2 id="spawning-threads">Spawning Threads</h2>
528529
Hi there!
529530
</pre></code></p>
530531
<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
533534
consume too many system resources.</p></p>
534535
<p>The internal state of a greenlet is generally a time-dependent
535536
parameter. There are a number of flags on greenlets which let

tutorial.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ In chronological order of contribution:
2121
[Boris Feld](https://github.com/Lothiraldan)
2222
[youngsterxyf](https://github.com/youngsterxyf)
2323
[Eddie Hebert](https://github.com/ehebert)
24+
[Alexis Metaireau](http://notmyidea.org)
2425

2526
This is a collaborative document published under MIT license.
2627
Have something to add? See a typo? Fork and issue a
@@ -46,7 +47,7 @@ down into a collection of subtasks whose operation does not
4647
depend on the other tasks and thus can be run
4748
*asynchronously* instead of one at a time
4849
*synchronously*. A switch between the two
49-
executions is known as a *context swtich*.
50+
executions is known as a *context switch*.
5051

5152
A context switch in gevent done through
5253
*yielding*. In this case example we have
@@ -82,7 +83,7 @@ they occur.
8283
The real power of gevent comes when we use it for network and IO
8384
bound functions which can be cooperatively scheduled. Gevent has
8485
taken care of all the details to ensure that your network
85-
libraries will implictly yield their greenlet contexts whenever
86+
libraries will implicitly yield their greenlet contexts whenever
8687
possible. I cannot stress enough what a powerful idiom this is.
8788
But maybe an example will illustrate.
8889

@@ -259,7 +260,7 @@ True</code>
259260
</pre>
260261

261262
Even though gevent is normally deterministic, sources of
262-
non-determinism can creep into your program when you beging to
263+
non-determinism can creep into your program when you begin to
263264
interact with outside services such as sockets and files. Thus
264265
even though green threads are a form of "deterministic
265266
concurrency", they still can experience some of the same problems
@@ -300,7 +301,7 @@ def foo(message, n):
300301
thread1 = Greenlet.spawn(foo, "Hello", 1)
301302

302303
# Wrapper for creating and runing a new Greenlet from the named
303-
# function foo, with the passd arguments
304+
# function foo, with the passed arguments
304305
thread2 = gevent.spawn(foo, "I live!", 2)
305306

306307
# Lambda expressions
@@ -339,8 +340,8 @@ g.join()
339340

340341
## Greenlet State
341342

342-
Like any other segement of code Greenlets can fail in various
343-
ways. A greenlet may fail throw an exception, fail to halt or
343+
Like any other segment of code, Greenlets can fail in various
344+
ways. A greenlet may fail to throw an exception, fail to halt or
344345
consume too many system resources.</p>
345346

346347
<p>The internal state of a greenlet is generally a time-dependent

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