Date: Tue, 14 Jan 2003 00:51:07 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Terry Lambert <tlambert2@mindspring.com> Cc: "Alan L. Cox" <alc@imimic.com>, Peter Wemm <peter@wemm.org>, arch@FreeBSD.ORG Subject: Re: getsysfd() patch #1 (Re: Virtual memory question) Message-ID: <200301140851.h0E8p78U078882@apollo.backplane.com> References: <20030114002831.1C8C12A89E@canning.wemm.org> <3E2381F8.85BB90A0@imimic.com> <200301140411.h0E4BgpN078032@apollo.backplane.com> <3E23A086.FC511354@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
: :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 <dillon@backplane.com> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301140851.h0E8p78U078882>