Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: Shared Memory in BSD4.3 is lacking? Message-ID: <12137@brl-adm.ARPA> Date: 4 Mar 88 22:15:01 GMT Sender: news@brl-adm.ARPA Lines: 61 In article <12033@brl-adm.ARPA> rbj@icst-cmr.arpa (Root Boy Jim) writes: > From: Chris Torek > Nobody was quite sure how mmap `ought' to work, and it never got > implemented.... > >.... in BSD. So those vendors who needed it, SUN and Sequent, implemented >it *differently*. Encore probably has another variation. ^^^^^^ If you're currently running Umax4.2, you get a very simple shared memory semantic which basically says, "Share this piece of my address space with any processes that I fork off". This shared memory does not survive across an exec, so basically any programs that try to make use of shared memory have to be monolithic. Seems crude and ugly, I know, but you'd be surprised how many programs can be parallelized very nicely using just this semantic. Great! Somebody actually implemented my idea! I hadn't thought about sharing only *some* of the data space, my idea was to share it all. Trivia bowl time (related to another comp.unix.wizards topic). Some have argued that a great way to access shared-memory regions is through the filesystem namespace. Well, there is at least one operating system out there that does just that. Which OS is that? [sound of Jeopardy theme music...] VMS. They're called "global segments". Of course, VMS has the interesting "feature" of not just treating the filesystem object as a handle for the shared memory region, but also using it to reference a FILE that the region is paged from/to. Whether this is good or bad is a mixed bag. Once the last person detaches from the global segment, voila` -- you have a regular file containing the data that was in the global segment (when the file is actually in use for paging it's inaccessible as a regular file). This can be seen as either a benefit or a security risk. One of the benefits is that once the last process detaches from the region it remains with its data intact to be attached by another process, consuming only filesystem space in the interim. Hell, you could even survive system shutdowns that way! (clean shutdowns only; no telling what state the file will be in after a crash!) [sound of Twilight Zone (Grateful Dead!) music...] Your friends at Sequent do the same thing. However, what they are really doing is marking certain pieces of the buffer cache resident and non-reclaimable, then mapping them into the processes space. +----------------+ Jim Paradis linus--+ +--+-------------+ | Encore Computer Corp. necntc--| | | E N C O R E | | 257 Cedar Hill St. ihnp4--+-encore!paradis | +-------------+--+ Marlboro MA 01752 decvax--| +----------------+ (617) 460-0500 talcott--+ Well, what's the pleasure in THAT??!! (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 All of a sudden, I want to THROW OVER my promising ACTING CAREER, grow a LONG BLACK BEARD and wear a BASEBALL HAT!! ... Although I don't know WHY!!