Interprocess shared memory .... but file backed?

Christopher Quinn
2002-03-08T15:09:21Z

Hello,

I know that a combination of mmap/shmem can be used to
achieve interprocess shared memory (notably Ralf
Engelschall's MM library).
However as far as I can tell this is anonymous memory only.
Are there any options if one initially maps a disk file via
mmap (in particular MAP_PRIVATE) for sharing that vm, such
that any access by a member of the sharing process group
will fault in the relevant file data page after which writes
to it are seen by all?

Of course clone(2) will give the necessary sharing of page
tables but my ideal is for sharing only of specified areas
of vm, not everything.

Anyone know of a way of doing this?

Thanks,
Chris Quinn

PS. I'm not subscribed! please ensure you CC. me!!