liveBook · Manning

Shared memory

Shared memory is a memory region or storage area accessible to multiple processes, threads, or other execution components for accessing or exchanging data.

How 2 Manning books explain it

Fast Python: High performance techniques for large datasets

How it is used
Uses shared storage to avoid array copies or make objects available to separate local processes.
How deep it goes
Works through NumPy sharing checks and Plasma setup, but defers naive shared-memory and low-level-lock implementations.
Examples
Uses a flipped image view and copy, plus a CSV-to-Plasma producer and separate consumers.
What you can do after
Apply it via NumPy sharing checks and Arrow Plasma object storage while recognizing mutation and coordination trade-offs.

Read how Fast Python: High performance techniques for large datasets explains shared memory →

Grokking Concurrency

A shared variable is a variable whose value can be accessed by multiple concurrent tasks.

How it is used
Enables concurrent tasks to exchange data through common memory, particularly when copying large amounts of data is costly.
How deep it goes
Defines shared memory, illustrates it with Python threads, and weighs speed against access conflicts without detailing allocation internals.
Examples
Uses a shared refrigerator, a Python producer–consumer array, and matrix tasks reading common inputs.
What you can do after
Apply it via Python threading to exchange data through a shared array while recognizing the need to coordinate conflicting access.

Read how Grokking Concurrency explains shared memory →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.