[SciPy-user] shared memory machines

Sturla Molden sturla@molden...
Fri Feb 6 09:38:17 CST 2009

On 2/6/2009 4:26 PM, Philip Semanchuk wrote:

> You are correct that posix_ipc doesn't close handles when deallocated.  
> THis is a deliberate choice -- the documentation says that closing the  
> handle makes the IPC object no longer available to the *process*. So  
> if one has multiple handles to an IPC object (say, inside multiple  
> threads), closing one would invalidate them all. But as I write this,  
> I'm wondering if that's not just a documentation bug and something  
> with which I ought to experiment.

I have been thinking about this as well. I am mostly familiar with 
Windows so excuse my terminology: We don't want an array to call 
CloseHandle() on a mapped segment that another array is still using. The 
effect would be global to the process. Thus, we would either need to 
maintain some sort of global reference count for all mapped shared 
resources, or make duplicates of the handle. On Windows there is a 
function called DuplicateHandle() that will do this. I am not sure about 

Sturla Molden

More information about the SciPy-user mailing list