Memory Boundary IPC
When the two processes do not share memory, memory boundary IPC blocks must be used. Each half of the stream must provide a separate set of packets. When new payloads arrive, the source block transmits all the data to the destination block, where it is copied into a new packet. Auxiliary communication channels may be set up for this purpose. Once transmission is done, the original packet is returned upstream for reuse, without waiting for the consumer to finish reading the data, since it accesses a different set of buffers.
These IPC blocks can also be used to create virtual memory boundaries between portions of a stream. If one consumer operates at a lower level of safety and/or security than the rest of the stream, then even if it can share memory with the rest of the stream, it may not be desirable to do so. Requiring this consumer to use its own set of buffers ensures that if it fails, it will not prevent the rest of the stream from continuing, and if it falls prey to a security issue, it won't be able to modify the buffer data seen by the other consumers.
- During setup phase:
- Synchronization:
- Synchronization objects are not exchanged across the memory boundary.
- Source and destination blocks provide their synchronization requirements for the producer and consumer, respectively.
- If necessary, creates sync objects to be used to coordinate the data copy, and passes to the local endpoint.
- Accesses sync objects from the local endpoint to coordinate data copy.
- Buffers:
- Exports a subset of the consumer element attributes from downstream and imports them upstream, replacing attributes related to memory access with those needed for the data transfer mechanism to access the memory.
- Exports a subset of the consolidated packet attribute list from upstream and imports them downstream, again replacing attributes related to memory access with those needed for the copy engine.
- On destination side, receives and maps buffers used for copy from downstream.
- Synchronization:
- During streaming phase:
- Source IPC block transmits payload data to the destination block.
- Destination IPC block reads the payload data into an available packet and passes it downstream.
- In non-safety builds, during streaming phase:
- Signals changes in packet attributes and buffers from source to destination.