Mail Archives: djgpp/2001/01/01/22:51:32
> 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.
- Raw text -