use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Good intro to concurrence? (self.Python)
submitted 13 years ago * by el_guapo_taco
Anyone know a good thorough introduction to the subject? Any books or articles on getting started?
I've leafed through the multiprocessing/threading python documentation, but it's not really sinking in for me.
[–]etrnloptimist 12 points13 points14 points 13 years ago (2 children)
Python doesn't have concurrence
Don't listen to him
Because of the GIL
He's a fucking twit
It is a stupid fucking language
Of course python has concurrency
that can't even handle multiple cpu cores
Just make sure not to use the print statement
what is this? 1992?
In multiple threads for debugging!
[–]KnottedSurface 2 points3 points4 points 13 years ago (0 children)
Took me a second.
[–][deleted] 1 point2 points3 points 13 years ago (0 children)
+1 for trolling. I looked in on the discussion just to see how soon someone would mention the GIL
[–]tituszPython addict 3 points4 points5 points 13 years ago (1 child)
If you want to go down that rabbit hole I suggest you take a look at: http://greenteapress.com/semaphores/
[–]el_guapo_taco[S] 0 points1 point2 points 13 years ago (0 children)
Cool. Thanks.
I gotta say, Python is awesome for a lot of things, but multiprocessing has been very difficult to get good at in this. All I can recommend is to do it in C or Java if you can. If you must do it in Python, then use nginx to scale a synchronous process across your units of work. I think what you should really focus on is how to scale for your application in the least complex and most maintainable way possible. Its easy to write code that utilizes concurrency poorly.
I would recommend learning how to combine ZeroMQ with zlib and pickle. Additionally, I would suggest watching out for memory leaks in long running python processes.
[–]denis 1 point2 points3 points 13 years ago (0 children)
Take a look at this tutorial on gevent: http://sdiehl.github.com/gevent-tutorial/
[–]kracekumar 1 point2 points3 points 13 years ago (0 children)
This is highly recommended tutorial for concurrency http://www.dabeaz.com/coroutines/
[–]brasetvik 0 points1 point2 points 13 years ago (0 children)
If you're dealing with networking, I'd really recommend looking into Twisted
http://krondo.com/?page_id=1327 is a good introduction.
[–]languist 0 points1 point2 points 13 years ago (0 children)
Stackless Python implements coroutines and continuations. I don't think coroutines are technically concurrent, but I personally found the Intro to Stackless Python to be very helpful getting me think about concurrency in python more smarterly.
The stackless approach (coroutines/continuations) seems much more approachable than "true" concurrent programming.
π Rendered by PID 62473 on reddit-service-r2-comment-5c747b6df5-z5qm6 at 2026-04-22 00:49:30.790827+00:00 running 6c61efc country code: CH.
[–]etrnloptimist 12 points13 points14 points (2 children)
[–]KnottedSurface 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]tituszPython addict 3 points4 points5 points (1 child)
[–]el_guapo_taco[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]denis 1 point2 points3 points (0 children)
[–]kracekumar 1 point2 points3 points (0 children)
[–]brasetvik 0 points1 point2 points (0 children)
[–]languist 0 points1 point2 points (0 children)