[Python-Dev] Pythonic concurrency

Bruce Eckel BruceEckel-Python3234 at mailblocks.com
Mon Oct 10 22:15:18 CEST 2005


> Yes, there's a troublesome meme in the world: "threads are hard".
> They aren't, really.  You just have to know what you're doing.

I would say that the troublesome meme is that "threads are easy." I
posted an earlier, rather longish message about this. The gist of
which was: "when someone says that threads are easy, I have no idea
what they mean by it."

Perhaps this means "threads in Python are easier than threads in other
languages."

But I just finished a 150-page chapter on Concurrency in Java which
took many months to write, based on a large chapter on Concurrency in
C++ which probably took longer to write. I keep in reasonably good
touch with some of the threading experts. I can't get any of them to
say that it's easy, even though they really do understand the issues
and think about it all the time. *Because* of that, they say that it's
hard.

So alright, I'll take the bait that you've laid down more than once,
now. Perhaps you can go beyond saying that "threads really aren't
hard" and explain the aspects of them that seem so easy to you.
Perhaps you can give a nice clear explanation of cache coherency and
memory barriers in multiprocessor machines? Or explain atomicity,
volatility and visibility? Or, even better, maybe you can come up with
a better concurrency model, which is what I think most of us are
looking for in this discussion.

Bruce Eckel    http://www.BruceEckel.com   mailto:BruceEckel-Python3234 at mailblocks.com
Contains electronic books: "Thinking in Java 3e" & "Thinking in C++ 2e"
Web log: http://www.artima.com/weblogs/index.jsp?blogger=beckel
Subscribe to my newsletter:
http://www.mindview.net/Newsletter
My schedule can be found at:
http://www.mindview.net/Calendar





More information about the Python-Dev mailing list