pengwann.utils.allocate_shared_memory#

utils.allocate_shared_memory(keys, data)#

Allocate one or more blocks of shared memory and populate them with numpy arrays.

Parameters:
keysiterable of str

A sequence of strings identifying each array to be put into shared memory.

dataiterable of ndarray

The arrays to be put into shared memory.

Returns:
memory_metadatadict of {str2-length tuple of tuple of int and data-type} pairs.

A dictionary containing metadata for each allocated block of shared memory. The keys are set by keys and the values are a tuple containing the shape and dtype of the corresponding array.

memory_handleslist of SharedMemory

A sequence of SharedMemory objects (returned to allow easy access to the unlink method).