Skip to Content
Modern Python Standard Library Cookbook
book

Modern Python Standard Library Cookbook

by Alessandro Molina
August 2018
Intermediate to advanced
366 pages
10h 14m
English
Packt Publishing
Content preview from Modern Python Standard Library Cookbook

There's more...

multiprocessing.Pool works in nearly the same way as multiprocessing.pool.ThreadPool. In fact, they share a lot of their implementation as one is a subclass of the other.

But there are some major differences that are caused by the underlying technology used. One is based on threads and the other on subprocesses.

The major benefit of using processes is that the Python interpreter lock won't limit their parallelism, and they will be able to actually run in parallel with each other.

On the other side, there is a cost for that. Using processes is both more expensive in startup time (forking a process is usually slower than spawning a thread), and more expensive in terms of memory used, as each process will need to have its own ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Matthew Wilkes

Publisher Resources

ISBN: 9781788830829Supplemental Content