delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/10:33:58

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE335BE2D@probe-2.Acclaim-Euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp AT delorie DOT com
Subject: RE: how to switch tasks?
Date: Thu, 17 Dec 1998 15:31:23 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

> Eli Zaretskii writes:
> > You could still 
> > implement a signal-based version of fork() when spawning a djgpp 
> > program from another djgpp application, since that can be done 
> > without ever bothering to invoke DOS
>
> How?  The only way I know is to use the debug interface (v2loadimage).  
> Is that what you had in mind?

Yes, or something similar to that. Is there any reason why this 
wouldn't work? It is a nasty method because the child process 
would be running in the same DPMI application space as the parent, 
so you wouldn't get any of the nice OS services like automatic 
freeing of resources on exit, faults would tend to kill both 
processes at the same time, and libc would need some heavy 
tweaking to understand how to implement sbrk() and how to handle 
program termination in this situation, but I think it should be 
possible.

I'm not seriously suggesting to do this: it is a very messy and 
awkward solution. But I think it would be theoretically possible, 
if someone needed a fork() routine badly enough...


	Shawn Hargreaves.



- Raw text -


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