delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/14/07:47:34

From: Christopher Croughton <crough45 AT amc DOT de>
Subject: Re: Multitasking in DJGP
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Mon, 14 Apr 1997 12:33:25 +0100
Cc: crough45 AT amc DOT de, djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.970414133551.10345E-100000@is> from "Eli Zaretskii" at Apr 14, 97 11:43:22 am
Mime-Version: 1.0
Message-Id: <97Apr14.133053gmt+0100.21890@internet01.amc.de>

Eli Zaretskii wrote:

> I know what `fork' does on Unix.  What I don't understand is what is so 
> important about the precise way `fork' works that you need to duplicate 
> it in DJGPP.  If you are willing to wait until the child exits, why can't 
> you just spawn the same program, like so:

Try doing it when the bit that does the fork is down in 10 levels
of function calls, and depends on gobal variables being set correctly
by the time it gets there.  In the case of tcsh, that includes all
the aliases and local shell variables, not just the environment which
is passed to the child.  Yes, with a trivial program the change is
equally trivial, but it's like the cases which use setjmp and longjmp.

> No, they are still called `child processes' on Unix, so this is not the 
> source of the misunderstanding.  I just don't understand what is it that 
> you value so much in the peculiar way `fork' works on Unix.

But in DOS although they are called the same they don't act the same.
Like a lot of things in DOS...

If the code had been written for DOS then I wouldn't need fork (although
it is still useful).  Or I could rewrite the whole thing, but then it's
not a port it's a rewrite...

Chris

- Raw text -


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