From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: Sharing memory Date: Tue, 4 Jan 2000 11:07:11 +0200 Organization: NetVision Israel Lines: 21 Message-ID: References: NNTP-Posting-Host: is.elta.co.il Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.netvision.net.il 946977031 11544 199.203.121.2 (4 Jan 2000 09:10:31 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 4 Jan 2000 09:10:31 GMT X-Sender: eliz AT is In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 3 Jan 2000, Jay wrote: > Is it possible to have a set of allocated memory that is shared between 2 > programs? For eg. If we allocate a buffer in program "A", have program "A" > execute child program "B" while passing the address of the buffer to program > "B", and have program "B" use the same memory allocate in program "A". Is > that possible? The simplest way to achieve this is to use a buffer in conventional memory. In fact, DJGPP programs do it all the time when one program invokes the other: the command-line arguments are passed through the so-called "transfer buffer", which is in conventional memory. See section 18.4 of the FAQ for more details. If this solution is somehow inappropriate or inconvenient, please post more details about your intended application. In general, as long as you run under a DPMI 0.9 host, all the programs share the same LDT, so given a selector and an offset, the child program can reach out and access any part of its parent's memory.