[Numpy-discussion] numpy/Windows shared arrays between processes?

Ray S subscriber100@rjs....
Tue Oct 9 16:32:45 CDT 2007

On 10/9/07, Sebastian Haase replied:
 > > Did you find that locks
 > > or semaphores were needed?
 > Maybe that's why it crashed ;-) !?  But for simple use it seems 

I just did some code (below) that does read/write to the array AFAP, 
and there is no crash, or any other issue (Win2000, py2.4, numpy 
Without the print statements, it does max both processors; with 
printing I/O only 58%.
Both processes can modify the array without issue either.
I'll experiment with

I had seen the Win mmap in this thread:
and here:

Note also that the Python mmap docs read "In either case you must 
provide a file descriptor for a file opened for update." and no 
mention of the integer zero descriptor option.
Access options behave as presented.

Because *NIX has MAP_SHARED as an option you'd think that there might 
be cross-platform share behavior with some platform checking if 
statements. Without a tag though, how does another process reference 
the same memory on NIX, a filename? (It seems)

 > > But I had the same
 > > issue as Mark Heslep
 > > 
 > > of creating a numpy array from a raw address (not a c_array).
 >I assume this is a different issue, but haven't looked into it yet.

Yes, a different methodology attempt. It would be interesting to know 
anyway how to create a numpy array from an address; it's probably 
buried in the undocumented C-API that I don't grok, and likely 
frowned upon.


More information about the Numpy-discussion mailing list