10 IPC and Data Movement

IPCREVIEWED: 2026-11-18

Parallel R workers have to exchange data, and the exchange often costs more than the work it carries. Workers in separate processes copy every value they send, through serialization. Threads in one process can share memory instead, and then every write to it has to be coordinated. This section covers the process side: serialization, memory mapping, and moving large objects.

After this section

  • Explain why serialization is expensive for parallel R
  • Describe the tradeoff between copying and shared memory
  • Estimate the peak memory of sending a large object to another process
  • Explain when memory mapping avoids a copy, and why it cannot share live R objects

The pages

  1. Serialization. Converting R objects to bytes and back, often the main cost of process-based parallelism.
  2. Memory Mapping. Sharing physical memory pages across process address spaces without copying.
  3. Large-Object Transfer and Chunking. Peak memory, streaming, and backpressure when moving large data between processes.

Before this section

Read Concurrency and Parallelism and Scheduling.

Where this leads

Multi-Interpreter Architecture keeps several interpreters inside one process, where they share an address space. Rust for Runtime Engineering offers Rust tools that can prevent the memory errors that shared memory creates.

Concurrency and Parallelism covers the coordination that shared memory demands. Sockets and pipes connect programs to I/O and each other. Message Passing and Channels provides a queue-based communication mechanism. Copying vs Zero-Copy Transfer covers the ownership transfer question and when zero-copy strategies work. Shared Immutable Vectors explores how to share data without copying.

Back to top