Mail Archives: djgpp/2000/02/14/16:02:04
In article <Pine DOT SUN DOT 3 DOT 91 DOT 1000213094533 DOT 29873H-100000 AT is>,
djgpp AT delorie DOT com wrote:
>
> On Thu, 10 Feb 2000, Rolf Campbell wrote:
>
> > Eli Zaretskii wrote:
> >
> > > > int_handler
> > > > {
> > > > read_last_string_from_file("tempfile.txt");
> > > > process_that_string_quickly_since_we_are_in_an_interrupt;
> > > > }
> > >
> > > That won't work (or, rather, will crash your system): you cannot
safely
> > > make DOS calls from a hardware interrupt handler, and reading
from a file
> > > requires a DOS call.
> >
> > But isn't the DJGPP timer interrupt really delayed until data is
> > acessed, and then called from the page-fault handler?
>
> You are mixing two things: the DJGPP signal handlers and hardware
> interrupt handlers.
>
> Signal handlers indeed run in a safe state, just like the rest of the
> application code, so you can do anything from them, including DOS file
> I/O.
>
> However, when a program calls DOS, signals are deferred until that
> call returns. Since spawning a child program requires a DOS call, the
> parent program will not get any signals until the child program exits.
>
> For this reason, I assumed that the original poster was talking about
> a real hardware interrupt handler, not a signal handler. And DOS file
> I/O cannot be done from a hardware interrupt handler.
>
Does this mean that this approach is possible ? If set up with a proper
timer interrupt ? (How is this done?) Can I in DOS compiled by DJGPP
have a file open fron the child program, and read the same file from
the interrupt handler ?
Is there a better way o accomplish this ?
Sent via Deja.com http://www.deja.com/
Before you buy.
- Raw text -