pipert.core.shared_memory

Module Contents

Classes

SharedMemory

A wrapper for posix_ipc.SharedMemory, posix_ipc.Semaphore and the correlating mapfile to simplify usage.

class pipert.core.shared_memory.SharedMemory(memory, semaphore, mapfile)[source]

A wrapper for posix_ipc.SharedMemory, posix_ipc.Semaphore and the correlating mapfile to simplify usage.

release_semaphore(self)[source]
acquire_semaphore(self)[source]
write_to_memory(self, byte_code)[source]

Writes a given byte code to the shared memory. Args:

byte_code: A byte string that’s to be written to the shared memory.

read_from_memory(self, size=0)[source]

Reads a segment from the shared memory according to size. Args:

size: The amount of bytes that are to be read.

Returns: The byte string stored in the memory.

free_memory(self)[source]

Cleans what is on the memory and deletes it.