[Numpy-discussion] Shared memory ndarrays (update)
zbyszek at in.waw.pl
Mon Apr 11 08:58:42 EDT 2011
On 04/11/2011 09:21 AM, Sebastian Haase wrote:
> I have a non python question:
> for Java there seems to exist a module/package/class called nio
> public abstract class MappedByteBuffer extends ByteBuffer
> A direct byte buffer whose content is a memory-mapped region of a file.
> Could this be used to share memory between Java applications and numpy ?
it could, but you'd have to do the parsing of data yourself. So nothing
fancy unless you want to reimplement numpy in Java :). But if you
use a mmaped file as a backing for a numpy array of one of the types
also available in Java (signed byte, short, int, long, float, double)
and then map it on the Java side with DoubleBuffer or FloatBuffer or
..., then it seems straightforward enough.
More information about the NumPy-Discussion