/dev/zero and MAP_ANON (was: Re: GC triggering ...)

Larry Kaplan lkaplan at bbn.com
Mon Jul 23 23:52:46 AEST 1990


In article <3713 at auspex.auspex.com> guy at 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 at bbn.com			 \____|||____/		10 Fawcett St.
(617) 873-2431			  /__/ | \__\		Cambridge, MA  02238



More information about the Comp.unix.wizards mailing list