Mail Archives: djgpp/2000/02/10/12:15:15
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 -