bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch to retrieve send rights for shared memory objects


From: Roland McGrath
Subject: Re: Patch to retrieve send rights for shared memory objects
Date: Sat, 26 Feb 2005 17:11:56 -0800 (PST)

> our reference is not a reference to the shared memory object, but to the 
> filenode.
> So we need three states: no senders, one, or many (the "one" is useful 
> if we want to know
> if we are the only mapper).
> 
> This is as much as we need to make users of nattach in SysV SHM happy.
> We know it is a questionable interface, but it is exactly the one extra 
> quirk
> we need for compatibility. (And if you know a better way, share it!)

There is not necessarily a single memory object.  Nothing says io_map can't
return different objects in different calls, as long as the sharing of the
actual data when mapped happens.  I hope this further emphasizes how
inappropriate a question it is to ask, "How many send rights are there to
the memory object?"  For other reasons, it is just about as inappropriate
to ask, "How many send rights are there to any such memory objects?"  A
question that is certainly reasonable is, "Is it known that there are no
mappings?"  It is also reasonable to ask, "Is it likely that there are
multiple mappings?"  Beyond that, you really can't necessarily pin it down
without undesireable presumptions about the natures of IPC and VM.  For
this, you need a bit and a half.  It seems reasonable to me to use two new
bits in st_mode and be done with it.  e.g.

#define S_IMAPPED    000100000000 /* Might be mmap'd.  */
#define S_IMAPPEDM   000200000000 /* Might be mmap'd more than once.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]