www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/04/07:53:24

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
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: <Pine.SUN.3.91.1000104110651.26733H-100000@is>
References: <ix7c4.34836$uj2 DOT 1027526 AT newscontent-01 DOT sprint DOT ca>
NNTP-Posting-Host: is.elta.co.il
Mime-Version: 1.0
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: <ix7c4.34836$uj2.1027526@newscontent-01.sprint.ca>
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019