Mail Archives: djgpp/2000/01/04/07:53:24
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 -