Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uwvax!barney.cs.wisc.edu!zwilling
From: zwilling@barney.cs.wisc.edu (Mike Zwilling)
Newsgroups: comp.os.mach
Subject: Sharing memory between tasks
Keywords: tasks, shared memory
Message-ID: <8651@spool.cs.wisc.edu>
Date: 2 Oct 89 19:04:50 GMT
Sender: news@spool.cs.wisc.edu
Reply-To: zwilling@barney.cs.wisc.edu (Mike Zwilling)
Organization: U of Wisconsin CS Dept
Lines: 32

I have a question on sharing memory between task.  I want multiple 
programs to share a common data structure.  Each program in this 
problem is very different except for the need to access this common 
data structure, therefore I want each program to run as a separate task.

From reading documentation, the steps to do this are:
    1. Start a parent task that vm_allocate's the common data structure
    3. Parent uses vm_inherit to set the inheritance properties
    3. Parent task forks a child task 
    4. Child task performs an exec to start a program

My question is: 
    After step 4, how does the child get a pointer to the common data 
    structure in virtual memory? 

Can this pointer be passed in a message?  Pointers do not seem to be
valid message types.

An obvious solution to the entire problem would be to create a Mach
server for the data structure and access the structure through RPC's.
But, I'm trying to eliminate the RPC overhead since the data structure
will not be shared across machines.

I will summarize to the net any email responses.

Thanks in advance for any help.  
----
--
Mike Zwilling   University of Wisconsin -- Madison              
Computer Sciences Dept.
1210 W. Dayton St.
Madison, WI  53706