O'Reilly logo

Python Recipes Handbook: A Problem-Solution Approach by Joey Bernard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Joey Bernard 2016

Joey Bernard, Python Recipes Handbook, 10.1007/978-1-4842-0241-8_12

12. Concurrency

Joey Bernard

(1)Fredericton, New Brunswick, Canada

Computers have been getting faster and faster over the decades, but we are starting to bump into some of the limitations of physics. This means that in order to get more work done, we need to move to using multiple processes in parallel. There are several techniques available within Python to support concurrent execution of code.

The first technique is to use threads to break up the work. The main problem with this method is that it suffers from the bottleneck caused by the GIL (Global Interpreter Lock ). Threads that are doing I/O or using certain modules, such as numpy, can get around this bottleneck. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required