[Numpy-discussion] Numpy arrays shareable among related processes (PR #7533)
Sturla Molden
sturla.molden at gmail.com
Wed May 11 18:48:22 EDT 2016
Elliot Hallmark <Permafacture at gmail.com> wrote:
> Strula, this sounds brilliant! To be clear, you're talking about
> serializing the numpy array and reconstructing it in a way that's faster
> than pickle?
Yes. We know the binary format of NumPy arrays. We don't need to invoke the
machinery of pickle to serialize an array and write the bytes to some IPC
mechanism (pipe, tcp socket, unix socket, shared memory). The choise of IPC
mechanism might not even be relevant, and could even be deferred to a
library like ZeroMQ. The point is that if multiple peocesses are to
cooperate efficiently, we need a way to let them communicate NumPy arrays
quickly. That is where using multiprocessing hurts today, and shared memory
does not help here.
Sturla
More information about the NumPy-Discussion
mailing list