lkaplan@bbn.com (Larry Kaplan) (07/23/90)
In article <3713@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >>>Rather than mapping a file, you can map /dev/zero, which provides zero >>>filled copy on write pages. > >No, it provides zero-fill on demand pages; there's no copy-on-write >involved, and no copy-on-write needed. > >>Ever hear of anonymous mapped memory. > >Yes, it's what you get when you "mmap()" "/dev/zero" in SunOS 4.x and >System V Release 4. > >>Check out the 4.3BSD Architecture Manual (PS1:6) for a description of >>this rarely (or almost never) implemented feature. Here is a question for you about mmap of /dev/zero. Is this a useful feature for unrelated processes to share memory? The nice thing about MAP_ANON on an arbitrary path name (or vnode) is the ability to have separate sets of unrelated processes sharing memory. Just choose some job related file name in /tmp and map it with MAP_ANON. The file name (vnode) is used simply for rendezvous but no space is actually allocated in the file. Paging is done to the normal paging areas. It seems that you couldn't have separate groups with /dev/zero. Are there any other ways to share zero-filled memory without consuming disk space (as with regular mapped files) for unrelated processes in these operating systems? #include <std_disclaimer> _______________________________________________________________________________ ____ \ / ____ Laurence S. Kaplan | \ 0 / | BBN Advanced Computers lkaplan@bbn.com \____|||____/ 10 Fawcett St. (617) 873-2431 /__/ | \__\ Cambridge, MA 02238
david@eng.sun.com ("Have you driven a Fnord lately?") (07/24/90)
In article <58352@bbn.BBN.COM> lkaplan@BBN.COM (Larry Kaplan) writes: >Here is a question for you about mmap of /dev/zero. Is this a useful feature >for unrelated processes to share memory? ... >Are there any other ways to share zero-filled memory >without consuming disk space (as with regular mapped files) for unrelated >processes in these operating systems? In SunOS you have to either use System V shared memory (which you can't really depend on since it's a kernel option), or use tmpfs (memory based filesystem, also a kernel option) and have the processes map a file on a tmpfs filesystem (usually /tmp). -- David DiGiacomo, Sun Microsystems, Mt. View, CA david@eng.sun.com
guy@auspex.auspex.com (Guy Harris) (07/25/90)
>Here is a question for you about mmap of /dev/zero. Is this a useful feature >for unrelated processes to share memory? Not as far as I know. There's nothing on which they can rendezvous.... >Are there any other ways to share zero-filled memory without consuming >disk space (as with regular mapped files) for unrelated processes in >these operating systems? Yes, you can use the shared memory mechanism provided by the S5 IPC mechanisms ("shmat()" and all that).