The considerations that need to be made during concurrent programming processes, and the problems that follow, are all connected to the way in which Python manages its memory. A deep understanding of how variables and values are stored and referenced in Python, therefore, would not only help to pinpoint the low-level bugs that cause the concurrent program to malfunction but also helps to optimize the concurrent codes. In this chapter, we will take an in-depth look into the Python memory model as well as its atomic types, specifically their places in the Python concurrency ecosystem.
The following topics will be covered in this chapter:
- The Python memory model, its components that support memory allocation on various levels, and the general philosophy in managing memory in Python
- The definition of atomic operations, the roles they play in concurrent programming, and how to use them in Python