Mail Archives: djgpp/1997/03/11/17:43:41
On 11 Mar 1997, Caspar Derksen wrote:
> With DJGPP, alarm() or signal() does not seem to work, although the
> FAQ suggests that signals and alarm should work.
Do you say that only based on the test program that you posted, or did
yoy try using `alarm' with a real program too? Your test program will
indeed prevent `alarm' and `signal' from working, because it doesn't
touch any memory while it loops in `main'. In DJGPP, signals are
implemented in a way that the signal handling is deferred until the
program is in its main execution thread and touches some of its data.
Therefore, a tight loop which doesn't access any memory is one of the two
cases which will defer the signal from being delivered until you exit
that loop. The other case is when your program calls a real-mode service,
like some DOS function, in which case the signal handler will be called
when that DOS function returns.
- Raw text -