Shared memory and IPC
vorlon at netexpress.net
Mon Sep 10 08:01:28 GMT 2001
On Mon, 10 Sep 2001, Luke Kenneth Casson Leighton wrote:
> the implementation has, if you to are pass over data
> structures between programs, presumably in exactly
> the same way that those DB apps are doing, you must
> preserve pointers / memory segment offsets.
> and that means using MMAP_FIXED.
> if anyone has any better ideas, love to hear them.
You say you're doing this to avoid a bottleneck. But the bottleneck is with
trying to pass an entire structure through a pipe. If you just pass
/pointers/ across the pipe, then it no longer matters if you've managed to
mmap() at exactly the same memory address, does it? Just pass relative
offsets between processes and let each process can keep track for itself of
the absolute base address that's valid for that process.
A lot more portable than trying to make sure everyone gets the same absolute
address for everything.
More information about the samba-technical