From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp Subject: Re: Two programs shared memory Date: Mon, 1 Jan 2001 21:19:03 Organization: Aspen Technology, Inc. Lines: 16 Message-ID: <3a50f447.sandmann@clio.rice.edu> References: <3A4F298B DOT 6020906 AT htsol DOT com> NNTP-Posting-Host: dcloan.hou.aspentech.com X-Trace: selma.aspentech.com 978406348 6504 10.32.115.107 (2 Jan 2001 03:32:28 GMT) X-Complaints-To: postmaster AT aspentech DOT com NNTP-Posting-Date: 2 Jan 2001 03:32:28 GMT X-NewsEditor: ED-1.5.8 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > I need to share about 50K memory between two programs in DOS. > Parent program calls child by spawn. > I understood from FAQ and archives I must allocate this memory > block in DOS memory. For best compatibility, this is true - but most of the DPMI providers you are likely to encounter share a single set of page tables and a common memory space. You could send a selector/offset pair to the child and access the memory directly in the parent that way. It depends on the environment and how much memory you need to pass. If you only need to share 50K, and compatibility on any DPMI environment is required - use DOS memory. If you had to pass much more, and know that you will only be using a few different platforms (like Win 9x or CWSDPMI) then you can safely read (and write!) memory between the parent/child directly.