Chapter 8
- Multithreading cannot possibly speed up Python code due to the global interpreter lock (GIL). In this chapter, we examined different approaches to multiprocessing; that is, running code using multiple processes.
- Using the
Process
interface, we can have more low-level control by subclassing it. ThePool
interface, on the other hand, offers a convenient way to distribute tasks across processes using theapply
andmap
methods. - Theano and TensorFlow automatically translate our code into a parallelized version by taking advantage of special operations such as matrix multiplication.