Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!news.cs.indiana.edu!msi.umn.edu!noc.MR.NET!gacvx2.gac.edu!gacvx2.gac.edu!scott From: scott@erick.gac.edu (Scott Hess) Newsgroups: comp.sys.next Subject: Re: NeXT equivalent of Shared Memory and Semaphores on SysV Message-ID: Date: 21 Feb 91 14:28:05 GMT References: <1991Feb21.152540.10679@noose.ecn.purdue.edu> Distribution: usa Organization: Gustavus Adolphus College Lines: 31 Nntp-Posting-Host: 138.236.10.8 In-reply-to: songer@orchestra.ecn.purdue.edu's message of 21 Feb 91 15:25:40 GMTLines: 31 In article <1991Feb21.152540.10679@noose.ecn.purdue.edu> songer@orchestra.ecn.purdue.edu (Christopher M Songer) writes: I'm looking to port a SysV piece of code. The code uses shared memory extensively. Can memory be shared between processes on the NeXT, and if so, how? I RTFM and it seemed to imply that memory can only be shared when there is a parent - child relationship between processes. This is not good enough. Nowhere, however, did it say: "Memory cannot be shared between arbitrary processes on the NeXT computer." So, I figured I'd ask before scrapping whole boatloads of code. Any task with access ability >= to the task in question can share that task's memory, no questions asked. For instance, two tasks running with "scott" access will be able to play with each other's memory. Of course, you'd generally not want to do that :-). Anyhow, the documentation is in /NextLibrary/Documentation/NextDev/OSSoftware/01_Mach for NextStep2.0, and a similar place for 1.0. Basically, you can get the task of a process from the pid, and you can share memory with a process by knowing it's task, and then mapping the memory into your own space. It looks to be fairly simple, though I've not tested it too much, yet (I've not that much use for it at this time, either). Later, -- scott hess scott@gac.edu Independent NeXT Developer GAC Undergrad "Tried anarchy, once. Found it had too many constraints . . ." "Buy `Sweat 'n wit '2 Live Crew'`, a new weight loss program by Richard Simmons . . ." Brought to you by Super Global Mega Corp .com