Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!usc!zaphod.mps.ohio-state.edu!wuarchive!rice!rice!sun-spots-request From: matrix!venkat@uunet.uu.net (D Venkatrangan) Newsgroups: comp.sys.sun Subject: Re: Sharing the entire data segment between tasks Keywords: Miscellaneous Message-ID: <1990Nov1.000728.23807@rice.edu> Date: 1 Nov 90 00:19:52 GMT Sender: sun-spots-request@rice.edu Organization: Sun-Spots Lines: 19 Approved: Sun-Spots@rice.edu Originator: spots@titan.rice.edu X-Sun-Spots-Digest: Volume 9, Issue 355, message 2 X-Original-Date: 10 Oct 90 17:07:36 GMT X-Refs: Original: v9n335 In article <1990Oct7.225628.1295@rice.edu> adimail!george@uunet.uu.net (George Pearson) writes: >the parent's data and use it in the computation. This is perfect except >that because of "copy-on-write", the child cannot modify even a single >variable without creating duplicate pages of data. Results cannot simply >be placed into the data because the parent process will never see them. >The problem here seems to be how to get the entire data area to be >MAP_SHARED across the fork. Use shared memory. Also, use vfork() instead of fork() and follow it immediately with the exec of the child. Pass the shared memory ID from parent to child as a command line arg in the exec call. In the child, map the shared memory ID to a virtual memory address using the shmat() call. If parent has stored pointers to locations within the shared memory you should try to map it to the same virtual memory address as in the parent. D. Venkatrangan Matrix Computer Systems, Inc. 7 1/2 Harris Rd, Nashua, NH 03062 suneast!venkat uunet!matrix!venkat (603) 888-7790