httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: Question: mmap und shared mem
Date Fri, 21 Aug 1998 13:25:52 GMT

In article <199808211209.OAA13259@isis.helios.de> you wrote:

>[...very good experiences...]

Hmmm... very problematic stuff, yes. Thanks for
sharing the information and experiences with them.

> For portable use of shared memory I currently use the following
> homegrown guidelines:

>   * For just shared memory to communicate between processes use
>     shmat and friends if available or use mmap if it really works
>     like on Solaris. Alternatively use things like MACH
>     vm_allocate/vm_inherit to get real shared memory.

>   * To speed up file reading by avoiding the kernel/user copy use
>     mmap for large files, but be prepared to fall back to read if
>     the mmap fails for some obscure reason.

>   * Use normal write for file updates and do not mix it with
>     mmap'ed reading of the same file.

Good guidelines. And what about the maximum size of a shared memory segment of
about 131072 bytes as mentioned in some books (for instance in Stevens)?  They
say that the size (as used with shmget) should be below 131072 bytes and that
each process can only shmget up to 6 segments. But in the manpages of the
current Unix derivates I do not see such a limit. Do you have any experiences
here, too? 

And BTW: Does anybody know about a little library which provides an
abstraction layer to this mess? Or have I write my own abstraction here?

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message