www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/27/11:51:15

Date: Mon, 27 Jul 1998 18:50:33 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
cc: djgpp-workers AT delorie DOT com, dj AT delorie DOT com
Subject: Re: Pipes
In-Reply-To: <m0z0orT-000S4XC@inti.gov.ar>
Message-ID: <Pine.SUN.3.91.980727184116.1183K-100000@is>
MIME-Version: 1.0

On Mon, 27 Jul 1998, Salvador Eduardo Tropea (SET) wrote:

>  Program A calls program B to talk with it. So A makes a spawn, but we don't 
> return from spawn and we need to run more code in A ... so we must do some 
> stack change.

How do you get to the ``more code in A'' that you need to run?

How about calling setjmp before spawn and then longjmp there from the 
code that is invoked when the child e.g. calls Int 31h?

> ). The problem is: What if in the middle time A wants to do it with another 
> program C? Ok, ok is crazy but we will have problems if that isn't supported 
> because we can't just disable spawn. 

You can detect the situation and return with an error.  I think in the 
first approximation, one subprocess is enough to play with (provided that 
there is indeed a limitation here).

> My experiment showed problems with a second call to spawn and I'm 
> not sure if the problem is in spawn or in the DPMI host or in DOS because the 
> second call to spawn returned in a very strange way. I put some prints to see 
> the stack before and after calling int 21h to spawn the child and I saw the 
> prints only ones!! something is very strange there. Any ideas.

It is not entirely clear to me how you switch tasks.  For example, when 
the thread returns to program A (the parent), you need to switch the PSP, 
or else DOS will use wrong file handles etc.  (This assumes that you did 
NOT use v2loadimage.  If you did, then the PSP problem doesn't apply.)

- Raw text -


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