Shared_Memory_Channel module

Header

structSource

The first record of the shared memory region: it identifies the channel and says how the rest is laid out.

magic and version mark a valid channel (checked on every call; a region that fails the check reads as corrupt). reader_status and writer_status say whether each end is DISCONNECTED, PAUSED or ACTIVELY_*: a new channel has an active reader and a disconnected writer. The offsets locate the OS-specific header, the queue cursors and the message data inside the region. full_memory_region_size_in_bytes is the size of the whole mapping and data_size_in_bytes the capacity of the message ring, always a multiple of 8. The fields are shared with the other process: read them, but do not write them.

Fields

magic: u32
version: u32
reader_status: enum s32 { DISCONNECTED :: 0; PAUSED :: 1; ACTIVELY_READING :: 2; }
writer_status: enum s32 { DISCONNECTED :: 0; PAUSED :: 1; ACTIVELY_WRITING :: 2; }
offset_to_os_specific_header: u32
offset_to_message_queue_header: u32
offset_to_message_data: u32
full_memory_region_size_in_bytes: s64
data_size_in_bytes: s64

See also