🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #12056

shared memory

#12056
From: Richard Tobin
Date: Fri, 21 Apr 1989 12:57
16 lines
1336 bytes
I have a program that uses the shm* routines to allocate memory that will
be shared between a process and its children.  It needs an unshared area,
a shared area, and another unshared area.  The precise addresses don't
matter (though they mustn't be too far apart) but the ordering does.

Under release 3 I just used sbrk(), shmat() and sbrk() again, but under
release 4 this puts the shared segment at a much higher address than the
other segments.  If I tell shmat() to put it just after the break, the
second sbrk() fails.

What's the best way round this?  (Answers like "change your program so
that the order doesn't matter" won't help.)  Must I use mmap()?  If so, do
I actually have to specify a file somewhere to correspond with the mapped
area?  And if so, will it use real disk space?

-- Richard
Technical Details
Message-ID: <18449.8903311208@subnode.aiai.ed.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: richard%aiai.edinburgh.ac.uk@nss.cs.ucl.ac.uk (Richard Tobin)
Newsgroups: comp.sys.sun
Subject: shared memory
Keywords: SunOS
Message-ID: <18449.8903311208@subnode.aiai.ed.ac.uk>
Date: 21 Apr 89 12:57:46 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 16
Approved: Sun-Spots@rice.edu
Original-Date: Fri, 31 Mar 89 13:08:14 BST
X-Sun-Spots-Digest: Volume 7, Issue 234, message 9 of 10