Skip to content

Commit c7a0fd1

Browse files
author
Balthazar Rouberol
committed
Various typos/missing commas/english whatnots corrected
Signed-off-by: Balthazar Rouberol <rouberol.b@gmail.com>
1 parent 7ffdf40 commit c7a0fd1

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

tutorial.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ whole queue. In the async case the maximum runtime is roughly 2
184184
seconds since none of the tasks block the execution of the
185185
others.
186186

187-
A more common use case, fetching data from a server
188-
asynchronously, the runtime of ``fetch()`` will differ between
189-
requests given the load on the remote server.
187+
In a more common use case, asynchronously fetching data from a server,
188+
the runtime of ``fetch()`` will differ between
189+
requests, depending on the load on the remote server at the time of the request.
190190

191191
<pre><code class="python">import gevent.monkey
192192
gevent.monkey.patch_socket()
@@ -225,9 +225,9 @@ asynchronous()
225225
## Determinism
226226

227227
As mentioned previously, greenlets are deterministic. Given the same
228-
configuration of greenlets and the same set of inputs and they always
229-
produce the same output. For example lets spread a task across a
230-
multiprocessing pool compared to a gevent pool.
228+
configuration of greenlets and the same set of inputs, they always
229+
produce the same output. For example, let's spread a task across a
230+
multiprocessing pool and compare its results to the one of a gevent pool.
231231

232232
<pre>
233233
<code class="python">
@@ -276,15 +276,14 @@ concurrency", they still can experience some of the same problems
276276
that POSIX threads and processes experience.
277277

278278
The perennial problem involved with concurrency is known as a
279-
*race condition*. Simply put is when two concurrent threads
279+
*race condition*. Simply put, a race condition occurs when two concurrent threads
280280
/ processes depend on some shared resource but also attempt to
281-
modify this value. This results in resources whose values become
281+
modify this value. This results in resources which values become
282282
time-dependent on the execution order. This is a problem, and in
283283
general one should very much try to avoid race conditions since
284-
they result program behavior which is globally
285-
non-deterministic.
284+
they result in a globally non-deterministic program behavior.
286285

287-
The best approach to this is to simply avoid all global state all
286+
The best approach to this is to simply avoid all global state at all
288287
times. Global state and import-time side effects will always come
289288
back to bite you!
290289

@@ -457,7 +456,7 @@ except Timeout:
457456
</code>
458457
</pre>
459458

460-
Or with a context manager in a ``with`` statement.
459+
They can also be used with a context manager, in a ``with`` statement.
461460

462461
<pre>
463462
<code class="python">import gevent
@@ -566,7 +565,7 @@ of our gevent stack.
566565

567566
This lets us integrate libraries that would not normally work with
568567
gevent without ever writing a single line of code. While monkey-patching
569-
is still evil, in this case it is a "usefull evil".
568+
is still evil, in this case it is a "useful evil".
570569

571570
# Data Structures
572571

@@ -684,7 +683,7 @@ either ``gevent.queue.Empty`` or
684683
``gevent.queue.Full`` in the operation is not possible.
685684

686685
In this example we have the boss running simultaneously to the
687-
workers and have a restriction on the Queue that it can contain no
686+
workers and have a restriction on the Queue preventing it from containing
688687
more than three elements. This restriction means that the ``put``
689688
operation will block until there is space on the queue.
690689
Conversely the ``get`` operation will block if there are
@@ -759,10 +758,9 @@ group.join()
759758
]]]
760759
[[[end]]]
761760

762-
This is very usefull for managing groups of asynchronous tasks
763-
that.
761+
This is very useful for managing groups of asynchronous tasks.
764762

765-
As mentioned above Group also provides an API for dispatching
763+
As mentioned above, ``Group`` also provides an API for dispatching
766764
jobs to grouped greenlets and collecting their results in various
767765
ways.
768766

@@ -890,8 +888,8 @@ of a program.
890888

891889
## Thread Locals
892890

893-
Gevnet also allows you to specify data which is local the
894-
greenlet context. Internally this is implemented as a global
891+
Gevent also allows you to specify data which is local to the
892+
greenlet context. Internally, this is implemented as a global
895893
lookup which addresses a private namespace keyed by the
896894
greenlet's ``getcurrent()`` value.
897895

@@ -965,8 +963,8 @@ WSGIServer(('', 8000), application).serve_forever()
965963
<code>
966964
</pre>
967965

968-
Flask's system is more a bit sophisticated than this example, but the
969-
idea of using thread locals as local session storage is nontheless the
966+
Flask's system is a bit more sophisticated than this example, but the
967+
idea of using thread locals as local session storage is nonetheless the
970968
same.
971969

972970
## Subprocess

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