From owner-freebsd-arch Tue Jan 14 0:51:15 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAA8F37B401 for ; Tue, 14 Jan 2003 00:51:13 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6867643ED8 for ; Tue, 14 Jan 2003 00:51:13 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.6/8.12.6) with ESMTP id h0E8p70i078883; Tue, 14 Jan 2003 00:51:08 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.6/8.12.6/Submit) id h0E8p78U078882; Tue, 14 Jan 2003 00:51:07 -0800 (PST) Date: Tue, 14 Jan 2003 00:51:07 -0800 (PST) From: Matthew Dillon Message-Id: <200301140851.h0E8p78U078882@apollo.backplane.com> To: Terry Lambert Cc: "Alan L. Cox" , Peter Wemm , arch@FreeBSD.ORG Subject: Re: getsysfd() patch #1 (Re: Virtual memory question) References: <20030114002831.1C8C12A89E@canning.wemm.org> <3E2381F8.85BB90A0@imimic.com> <200301140411.h0E4BgpN078032@apollo.backplane.com> <3E23A086.FC511354@mindspring.com> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : :Matthew Dillon wrote: :> :> This is a first-attempt workup of getsysfd(). See? I told ya it was :> trivial! : :[ ... ] : :What does this uniquely do, which can be done no other way, again? : :-- Terry What Peter asked for (and what this does) is give you a descriptor that is associated with just a VM Object. You can then mmap() the descriptor, pass it to other processes and they can mmap() it too. It's a way of doing swap-backed shared memory without having to deal with the filesystem. The only other solutions are: * SysV shared memory, which is not fun to manage and may have weird size limitations, and has a race condition where a process dying at just the wrong time may leave a shmem segment lying around in the kernel. * A file, which uses the filesystem as backing store. Even with MAP_NOSYNC a shared file still uses the filesystem as backing store. This is typically not what is desired. Another thing I would like to do is descriptor-based timers. So instead of being limited to just the stupid itimers, or interfering with other threads/libraries use of [i]timers, you can simply allocate your own by getting a timer descriptor and then doing cool things with it, like having it generate a custom signal or selecting on it or kqueue'ing on it etc... it's something UNIX has needed for a long time actually. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message