delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/10/11:51:31

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: function fork()
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <8ab73tcgn9f63eqo7k6ed45dh5472mnj9e@4ax.com>
References: <3a2fe050$1 AT news DOT gemsoft DOT net> <Pine DOT SUN DOT 3 DOT 91 DOT 1001210081950 DOT 700D-100000 AT is>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 42
X-Trace: +r9wQ36IfQI9vOV8ExGMNCPcHnB7YelVXEeODUFkoh9WHqnvrDed7WT54Qzw+qTJswRZ4EajnYzC!6mIvxGSGhOOlsFmzOw3o8JpUxZSiBMnTItIDl9l/SvTp1p8myp7RAkElCUL3cL/2xclfd8vZ08EI!CTn+Yg==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Sun, 10 Dec 2000 16:22:16 GMT
Distribution: world
Date: Sun, 10 Dec 2000 16:22:16 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Sun, 10 Dec 2000 08:34:17 +0200 (IST), Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> wrote:

>
>On 7 Dec 2000 cat AT animal DOT u-net DOT com wrote:
>
>>     In the case of a program p2fork for example it might be possible
>> to save the state of the running version of the program to a data file
>> and then replicate the program with a line such as
>> 
>>     system("start /b p2fork --restart=data");
>
>Note that restarting a program from a disk file is not an easy task.  You 
>cannot let start.exe (which is a stock Windows program) do that, because 
>it doesn't understand the structure of the file to which you write the 
>memory image of the running program.  If you want p2fork itself do that, 
>it needs to include code that can read a file into memory, set up an 
>execution environment expected by DJGPP programs (segment registers, 
>memory arena--stack and heap--, exception handlers, etc.), then release 
>its own memory and other resources, and jump into the code it read from 
>disk.

In other words, create and load a "continuation," right?

>> It may be necessary to modify the .pif for p2fork after it has been
>> invoked to make it keep using CPU time when running in background mode.
>
>I think this isn't required.  It suffices to change the properties of the 
>DOS box to not suspend in background.  The DOS box properties are used by 
>default for each DOS program that doesn't have a PIF file of its own.

The DOS box properties _are_ a PIF file.  Let's see... I compile Hello
World with DJGPP, edit the DOS box properties, and type `ls'...
...wow, a PIF file!

-- 
<O
( \   GNOME vs. KDE: the game!
 X    http://pineight.8m.com/nes.htm

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


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