Skip to content
Permalink
Browse files

Thoughts inspired by recently-watched videos

  • Loading branch information...
Bruce Eckel
Bruce Eckel committed Jun 20, 2018
1 parent 569dd89 commit c45641f83f45eea6f888809c932c3ea37ca142ad
Showing with 26 additions and 22 deletions.
  1. +11 −11 Chapters/00_Notes.md
  2. +15 −11 Chapters/02_Introduction.md
@@ -7,14 +7,13 @@ is where all the details and complexity lie for the various concurrency strategi

- On top of this, a small fraction of problems use some concurrency solutions as a structuring mechanism.
Usually the driving force is "not fast enough" but sometimes (ironically) it can be
"too complicated." In general using concurrency when speed is not your problem
seems like a code smell.
"too complicated."

The concept of whether something is synchronous refers to when a function
finishes vs. when a function returns. In the vast majority of Python code these
two points are identical, a.k.a synchronous: a function returns when it
finishes. But with an asynchronous call, the function returns control to the
caller *before* the function finishes---typically much sooner. So the two
finishes vs. when a function returns. In the vast majority of Python code a
function returns when it finishes, so these two points are identical, that is,
*synchronous*. But with an asynchronous call, the function returns control to
the caller *before* the function finishes---typically much sooner. So the two
events, returning and finishing, now happen at different points in time: they
are *asynchronous*.

@@ -26,6 +25,12 @@ Ideally, make tasks that don’t block on other tasks (deadlock prone)
## For Study and Exploration
> Feel free to pull-request something you think might be helpful here
- Trio
- [docs](https://trio.readthedocs.io/en/latest/)
- [Difference between asyncio and curio](https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/)
- [Docs](http://curio.readthedocs.io/en/latest/)
- [Repo](https://github.com/dabeaz/curio)

- General Concurrency
- [Ted Leung](http://www.slideshare.net/twleung/a-survey-of-concurrency-constructs)
- [The Art of Multiprocessor Programming, Revised Reprint](http://amzn.to/2j1oneL)
@@ -60,11 +65,6 @@ Ideally, make tasks that don’t block on other tasks (deadlock prone)
- [Docs](http://aiohttp.readthedocs.io/en/stable/)
- [An Intro](http://stackabuse.com/python-async-await-tutorial/)

- Curio (and the newer Trio)
- [Difference between asyncio and curio](https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/)
- [Docs](http://curio.readthedocs.io/en/latest/)
- [Repo](https://github.com/dabeaz/curio)

- Remote Objects
- [Pyro4](https://pythonhosted.org/Pyro4/) Mature Python remote object implementation.

@@ -1,14 +1,16 @@
Introduction
============

> "Double, double toil and trouble; Fire burn and caldron bubble."---William Shakespeare, *MacBeth*
> "Double, double toil and trouble; Fire burn and caldron bubble."---William
> Shakespeare, *MacBeth*
The only justification for concurrency is if your program doesn't run fast
enough. There are a few languages designed to make concurrency relatively
effortless---at least, their particular flavor of concurrency, which might or might
not fit your needs---but these are not yet the most popular programming languages.
Python does what it can to make concurrency "Pythonic," but you must still work
within the limitations of a language that wasn't designed around concurrency.
effortless---at least, their particular flavor of concurrency, which might or
might not fit your needs---but these are not yet the most popular programming
languages. Python does what it can to make concurrency "Pythonic," but you must
still work within the limitations of a language that wasn't designed around
concurrency.

You can be thoroughly fluent in Python and know little to nothing about
concurrency. Indeed, for this book I expect those exact credentials. This means,
@@ -82,12 +84,14 @@ code. Different strategies also have domains of application where they shine,
and other domains where they don't provide much benefit, or can even produce
slower results.

The term "concurrency" is often defined inconsistently in the literature. One of
the more common distinctions declares concurrency to be when all tasks are
driven by a single processor, vs *parallelism* where tasks are distributed among
multiple processors. There are (mostly historical) reasons for this difference,
but in this book I relegate "the number of processors driving the tasks" as one
of the many variables involved with the general problem of concurrency.
The term "concurrency" is often defined inconsistently in the literature. One
of the more common distinctions declares concurrency to be when all tasks are
driven by a single processor, vs *parallelism* where tasks are distributed
among multiple processors. There are (mostly historical) reasons for this
difference, but in this book I relegate "the number of processors driving the
tasks" as one of the many variables involved with the general problem of
concurrency. Concurrency doesn't increase the number of CPU cycles you have
available---it tries to use them better.

Concurrency is initially overwhelming precisely because it is a general goal
("make a program faster using tasks") with myriad strategies to achieve that

0 comments on commit c45641f

Please sign in to comment.
You can’t perform that action at this time.