From owner-freebsd-hackers Sat Feb 10 12:24:16 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id D2AC937B401; Sat, 10 Feb 2001 12:23:58 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id f1AKNMO27394; Sat, 10 Feb 2001 12:23:22 -0800 (PST) (envelope-from dillon) Date: Sat, 10 Feb 2001 12:23:22 -0800 (PST) From: Matt Dillon Message-Id: <200102102023.f1AKNMO27394@earth.backplane.com> To: Richard Hodges Cc: Nik Clayton , hackers@FreeBSD.ORG Subject: Re: Updating mmap(2) [nik@freebsd.org: Re: pipe] References: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :> mmap - allocate memory, or map files or devices into memory :> :> would be better? : :You have my vote. That information would have saved me quite a few :hours of angst a few years ago when I was looking for a way to share :memory between processes. In fact, it will probably be an important :tool for me for some time to come. In one case, using threads (instead :of processes) with a decent amount of I/O increases load by about 20%. : :While you're at it :-) maybe you could add a few lines suggesting that :with the MAP_SHARED flag, this is a useful method of sharing memory :between processes. : :> In addition, mmap isn't listed in the SEE ALSO for malloc(3), nor is it :> listed in memory(3). mmap() is listed in malloc(3), but only in an :> error message. : :Sounds good to me. : :-Richard : :------------------------------------------- : Richard Hodges | Matriplex, inc. Not only that, but you can mmap() anonymous memory MAP_SHARED as well, which means the memory is shared across fork(). Theoretically it is possible to share a memory region across an exec*() as well, but I've never been able to get that to work. The MAP_NOSYNC section of the manual page has a very good description of how to use mmap() for IPC, but the MAP_SHARED section could use some more meat. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message