Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!uwvax!caseus.cs.wisc.edu!zwilling From: zwilling@caseus.cs.wisc.edu (Mike Zwilling) Newsgroups: comp.os.mach Subject: Re: shared memory in Mach? (Esp. for NeXT) Message-ID: <1991Feb21.210919.1178@spool.cs.wisc.edu> Date: 21 Feb 91 21:09:19 GMT References: <1991Feb21.072121.24132@rfengr.com> Sender: news@spool.cs.wisc.edu (The News) Organization: U of Wisconsin CS Dept Lines: 34 In article <1991Feb21.072121.24132@rfengr.com> brian@coconut.com writes: > >Forgive me if this is a stupid question. Here goes: > >Does anyone know if a simple way to implement the equivalent of >AT&T System V shared memory in a Mach-style environment? Mach is >supposed to be quite powerful with regard to interprocess communication. >What's the *easiest* way to have two unrelated processes share a chunk >of memory by attaching it to their address space and reading/writing it? >Assume the processes are not children of each other. I want one >process to be able to communicate with a completely unrelated process >using the fastest method possible (which I assume would be some >direct memory operation). Two unrelated processes (tasks) in Mach can share (read/write) memory in Mach using a memory_object. Any tasks which map the memory object into their virtual address space, will share memory with other tasks mapping the same object. The intialization and paging for a memory object must be managed by a server (external pager). An external pager is represented by a port which responds to RPC's from the kernel. Therefore, it can be implemented as a separate task or simply as a thread in one of the tasks which is sharing the memory. A good example of such a server is the netmemory server which is supplied in the Mach 2.5 release. This server supports r/w sharing of memory for multiple memory_objects, even across a network. Mike -- Mike Zwilling University of Wisconsin -- Madison Computer Sciences Dept. 1210 W. Dayton St. Madison, WI 53706 email: zwilling@cs.wisc.edu ph# (608) 263-4076 Brought to you by Super Global Mega Corp .com