Threading in Python - Real Python
Threading in Python
Lee Gaines 25 Lessons 2h 16m intermediate best-practicesPython threading allows you to have different parts of your program run concurrently and can simplify your design. If you've got some experience in Python and want to speed up your program using threads, then this course is for you!
In this course, you'll learn:
- What threads are
- How to create threads and wait for them to finish
- How to use a
ThreadPoolExecutor - How to avoid race conditions
- How to use the common tools that Python
threadingprovides
This course assumes you've got the Python basics down pat and that you're using at least version 3.6 to run the examples. If you need a refresher, you can start with the Python Learning Paths and get up to speed.
If you're not sure if you want to use Python threading, asyncio, or multiprocessing, then you can check out Speed Up Your Python Program With Concurrency .
What's Included:
- 25 Lessons
- Video Subtitles and Full Transcripts
- Translated Subtitles in 8 Languages
- 1 Downloadable Resource
- Accompanying Text-Based Tutorial
- Interactive Quiz to Check Your Progress
- 5 Hands-On Coding Exercises
- Q&A With Python Experts: Ask a Question
- Certificate of Completion
Downloadable Resources:
Related Learning Paths:
Start NowThreading in Python
25 Lessons 2h 16m
- 1. Threading in Python: Overview 01:07
- 2. What Is a Thread? 03:08
- 3. A Single Thread 02:05
- 4. Two Threads 05:38
- 5. Daemon Threads 03:26
- 6. Joining Threads 03:21
- 7. Multiple Threads 04:04
- 8. Exercise: Run Jobs in Background Threads 08:00
- 9. Thread Pool 03:55
- 10. Exercise: Speed Up Work With a Thread Pool 08:00
- 11. Race Conditions 01:50
- 12. Example: Bank Account Program 08:03
- 13. Lock Objects 04:35
- 14. Exercise: Fix a Race Condition With a Lock 08:00
- 15. More Locks 04:30
- 16. The Producer-Consumer Pipeline: Part 1 01:42
- 17. The Producer-Consumer Pipeline: Part 2 11:33
- 18. The Producer-Consumer Pipeline: Part 3 06:36
- 19. The queue Module: Part 1 13:59
- 20. The queue Module: Part 2 04:20
- 21. Exercise: Drain Messages From a Queue 08:00
- 22. Semaphore Objects 05:19
- 23. Exercise: Cap Concurrent Workers With a Semaphore 08:00
- 24. Threading in Python (Quiz) 06:30
- 25. Threading in Python: Summary 01:16
About Lee Gaines
Lee is a DevOps Engineer and Pythonista based in Berkeley, California.
» More about LeeEach tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:
Dan
Joanna
Sadie
Tappan
Jim
Brad
Aldren
Related Courses:
Hands-On Python 3 Concurrency With the asyncio Module
Thread Safety in Python: Locks and Other Techniques
Speed Up Python With Concurrency
Yuri
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!