14
Concurrency
Concurrency is the art of making a computer do (or appear to do) multiple things at once. Historically, this meant inviting the processor to switch between different tasks many times per second. In modern systems, it can also literally mean doing two or more things simultaneously on separate processor cores.
Concurrency is not inherently an object-oriented topic, but Python's concurrent systems provide object-oriented interfaces, as we've covered throughout the book. This chapter will introduce you to the following topics:
- Threads
- Multiprocessing
- Futures
- AsyncIO
- The dining philosophers benchmark
The case study for this chapter will address ways we can speed up model testing and hyperparameter tuning. We can't make the computation ...
Get Python Object-Oriented Programming - Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.