delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/10/12:15:15

From: "Campbell, Rolf [SKY:1U32:EXCH]" <moscoop AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How Do I start another DOS program from DJGPP ?
Date: Thu, 10 Feb 2000 11:03:46 -0500
Organization: Nortel Networks
Lines: 43
Message-ID: <38A2E162.CDB2C9FD@americasm01.nt.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000208094014 DOT 28790K AT is> <87p46p$e4u$1 AT nnrp1 DOT deja DOT com> <38A183C7 DOT AC3F0097 AT americasm01 DOT nt DOT com> <87ucs9$7at$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: wmerh0tk.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.71 [en] (X11; I; HP-UX B.10.20 9000/785)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

arcadepreserv AT hotmail DOT com wrote:

> How about this approach then ?
>
> frontend.c
>
> main{
> ...
> setup_timer_interrupt_to_call_int_handler_often_enough;
> exec_dos_program("backend.exe>tempfile.dat");
> ...
> }
>
> int_handler
> {
> read_last_string_from_file("tempfile.txt");
> process_that_string_quickly_since_we_are_in_an_interrupt;
> }

    I have never tried this before, so I might not be correct, but I
don't know whether you can access the file in the timer interrupt (since
DJGPP fakes the time interrupt with invalidating DS, and then calls the
user code after the interrupt has finished, does that mean that the time
interrupt can access unlocked memory and do dmpi_int calls?)
    Also, the output file may be locked.
    Also, I don't think timer interrupt would call the parent program,
unless the child program was not a DJGPP app.  Because when the interrupt
fires, and DS is invalidated, the next thing to run will be the child
program, which would generate a sigsev when it tried to access any data,
and it's handler would make a call to it's internal timer function
completely avoiding the parent program's timer function.  And even if the
child wasn't a DJGPP program, then the timer would only fire once after
the whole program was done.

    And to top this all off, the child program may use buffered IO which
would mean that (even if that timer approach worked), you would only get
data in large chunks

--
(\/) Rolf Campbell (\/)



- Raw text -


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