From: Damian Yerrick 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> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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! --