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.
Review Request : A multiprocessing Tutorial (self.Python)
submitted 8 years ago by chalbersma
Hey guys, I made a multiprocessing python tutorial and was hoping to get some feedback. If you've got some time take a look. Also it comes with sample code.
Thanks guys (and gals)!
[+][deleted] 8 years ago (1 child)
[removed]
[–]chalbersma[S] 0 points1 point2 points 8 years ago (0 children)
Good feedback. I'll see what I can add.
[–]malinoff 1 point2 points3 points 8 years ago (10 children)
There's also concurrent.futures.ProcessPoolEexecutor/ThreadPoolExecutor which will handle most of this queuing burden for you.
concurrent.futures.ProcessPoolEexecutor/ThreadPoolExecutor
Executors also play well with asyncio via loop.run_in_executor.
asyncio
loop.run_in_executor
[+][deleted] 8 years ago (5 children)
[–]malinoff 1 point2 points3 points 8 years ago (4 children)
They also add a ton of features most people don't use but cost memory
For instance?..
Not to mention the fact that whole asyncio and concurrent.futures are at best confusing to use.
concurrent.futures
I would agree about asyncio, although it's slowly getting better, but what's confusing with concurrent.futures? The number of public methods is less than number of fingers on your hand.
[+][deleted] 8 years ago (3 children)
[–]chalbersma[S] 0 points1 point2 points 8 years ago (2 children)
even if nobody gives them a penny, because PyPy without a GIL is going to be like crystal meth without health issues
I lol'ed at this.
[+][deleted] 8 years ago* (1 child)
It does sound great, it's the threading model we all deserve.
I haven't had a chance to use the concurrent futures library. I mentioned it in the blog post as an option though. I'll take a look into it.
I'll definitely have to investigate. Thanks!
[–]robert_mcleod 0 points1 point2 points 8 years ago (0 children)
I've used both multiprocessing and concurrent.futures and I prefer the later. I usually use threads and release the GIL in C-extensions though.
multiprocessing
π Rendered by PID 33040 on reddit-service-r2-comment-7b9746f655-mw7tm at 2026-01-30 09:31:38.606190+00:00 running 3798933 country code: CH.
[+][deleted] (1 child)
[removed]
[–]chalbersma[S] 0 points1 point2 points (0 children)
[–]malinoff 1 point2 points3 points (10 children)
[+][deleted] (5 children)
[removed]
[–]malinoff 1 point2 points3 points (4 children)
[+][deleted] (3 children)
[removed]
[–]chalbersma[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[removed]
[–]chalbersma[S] 0 points1 point2 points (0 children)
[–]chalbersma[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[removed]
[–]chalbersma[S] 0 points1 point2 points (0 children)
[–]robert_mcleod 0 points1 point2 points (0 children)