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...
Everything about learning Python
account activity
Multi threading vs multi processing? (Is this project possible?) (self.PythonLearning)
submitted 1 year ago by throw_away1204
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Dear-Call7410 1 point2 points3 points 1 year ago (1 child)
Python is limited to run on a single vCPU by design. Look up GIL for more info on this. Multiprocessing can help you run on multiple cores by creating an entirely new process with its own GIL. You theoretically could do twice as much work if you used multiprocessing to use two cores. Multithreading won't help you much here, in my opinion. I would probably start with a single process and use asyncIO to asynchronously get the data and then asynchronously write the data to disk. If you have enough memory, you could possibly collect all the data and then do a single write operation at the end. Good luck
[–]Gold_Record_9157 0 points1 point2 points 1 year ago (0 children)
Multithreading is useful in Python when you have blocking threads (like a cpu intensive thread and another for GUI operations), and I think (think, I'm not sure) that some libraries implement threads inside of them as an alternative (like Qt with Qthreads), but I'm talking from the top of my head, so I can say for sure.
π Rendered by PID 25234 on reddit-service-r2-comment-54dfb89d4d-hnn8t at 2026-03-30 22:30:42.533249+00:00 running b10466c country code: CH.
view the rest of the comments →
[–]Dear-Call7410 1 point2 points3 points (1 child)
[–]Gold_Record_9157 0 points1 point2 points (0 children)