www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/27/12:08:34

Message-Id: <m0z0pnZ-000S4oC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization: INTI
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com,
dj AT delorie DOT com
Date: Mon, 27 Jul 1998 13:16:36 +0000
MIME-Version: 1.0
Subject: Re: Pipes
References: <m0z0orT-000S4XC AT inti DOT gov DOT ar>
In-reply-to: <Pine.SUN.3.91.980727184116.1183K-100000@is>

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
 
> 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?

A called B and now A will receive information from B (a write from B). Now I 
must execute code in A. One thread inside A is waiting for the end of B 
inside spawn, a new thread in A must receive the data from B and do all the 
stuff.
I'm in DOS spawning and not in Windows calling start ;-)
 
> How about calling setjmp before spawn and then longjmp there from the 
> code that is invoked when the child e.g. calls Int 31h?

Even when what you say is wrong (could leak memory if it is allocated by 
spawn) I think we can jump to the point where spawn called B. Additionally we 
must check at this point if we are jumping or is DOS returning. But I think 
it could be done with some hooks in dosexec.
 
> > ). 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).

Yes as a toy is OK, but isn't good as solution. But we must go step by step 
;-)
 
> > 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.)

I'm not switching the PSP and the only file I'm using is stdout to print. So 
that isn't the problem. Something fails when spawn is called twice. I'll try 
longjmping inside spawn to avoid it.

SET


 
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


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