Threading in Python: Summary
You’ve now seen much of what Python threading
has to offer and some examples of how to build threaded programs and the problems they solve. You’ve also seen a few instances of the problems that arise when you’re writing and debugging threaded programs.
If you’d like to explore other options for concurrency in Python, check out Speed Up Your Python Program With Concurrency. If you’re interested in doing a deep dive on the asyncio
module, go read Async IO in Python: A Complete Walkthrough.
Whatever you do, you now have the information and confidence you need to write programs using Python threading!
Take the Quiz: Test your knowledge with our interactive “Python Threading” quiz. You’ll receive a score upon completion to help you track your learning progress:
Interactive Quiz
Python ThreadingThis is a quiz that will review topics covered in our An Intro To Threading tutorial.
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
00:00 Congratulations again on finishing this course on an introduction to threading in Python. Let’s just quickly go over what you have learned.
00:12
First off, you learned what a thread is and what multi-threading is. You learned about some of the features from a few different Python modules, including threading
, concurrent.futures
, and queue
.
00:28
You learned how to build multi-threaded apps manually using Thread
objects, Lock
objects, and different mechanisms that come from the modules listed above.
00:41 And you learned how to refactor apps using some of the modules listed above, for example, using locks as a context manager, instead of acquiring and releasing them manually.
00:53 And then at the end, you built a full-blown thread-safe message queue system that you can use now to create your own message queues. So, congrats on finishing this course, and I hope you found it helpful in understanding what a thread is and how to build multi-threaded apps. I’ll see you in the next one!
Ghani on Oct. 29, 2020
Excellent course; Thank you so much!
williamhoward50 on Feb. 24, 2022
Excellent course.
Yuri on June 8, 2022
Great Course! I think it is probably one of the best (if not the best) explanation of threading & queue topic I have seen on the internet! Thanks!
ross24 on Jan. 7, 2024
Agree with others that this is the best explanation of threading, etc on the internet. I’m not sure if other related lessons exist regarding threading but if there are, it would be nice to have a recommneded next steps suggestion.
John M on March 22, 2024
Thanks for the great tutorial, Lee. In the queue example, how can I create many consumer threads while only having one producer?
Become a Member to join the conversation.
jeffgorzen on May 3, 2020
I wish the example code and slide show was left on the sight!