In this lesson, you’ll see which situations might be better suited to using either concurrent.futures or multiprocessing. You’ll also learn about how that ties in with the Global Interpreter Lock (GIL).
Because of the GIL, no two threads can execute Python code at the same time. So even if you have multiple threads running in your Python program, only one of them can execute at a time. The best way to get around this is to use process-based parallel programing, or process-based parallelism.
Congratulations, you made it to the end of the course! Make it stick: Mentor AI will check what you’ve got down, help you build something with it, and find your #1 takeaway to share in the discussion.
Or go straight to the discussion section and share your #1 takeaway and how you’ll put your new skills to use.
Divyanshu Sharma on July 27, 2020
Can you explain how does
multiprocessing.dummycompare toconcurrent.futures.ThreadPoolExecutor?