14.8 Exercises
We’ve covered several different concurrency paradigms in this chapter and still may not have provided a clear idea of when each one is useful. This lack of clarity suggests that it’s generally best to develop a few different strategies before committing to one that is measurably better than the others. The final choice must be based on measurements of the performance of multi-threaded and multiprocessing solutions.
Concurrency is a huge topic. As your first exercise, we encourage you to search the web to discover what are considered to be the latest Python concurrency best practices. It can help to investigate material that isn’t Python-specific to understand operating system primitives such as semaphores, locks, and queues.
Be sure to search for articles on “free-threading in Python.” These will describe Python without the GIL. This is still several years away from being available, but it is a possible future...