delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/11/17:43:41

Date: Wed, 12 Mar 1997 00:18:56 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Caspar Derksen <caspard AT sci DOT kun DOT nl>
cc: djgpp AT delorie DOT com
Subject: Re: signal() and alarm() - Bug?
In-Reply-To: <5g454h$lh0@hera.cs.kun.nl>
Message-ID: <Pine.SUN.3.91.970312001408.2704Y-100000@is>
MIME-Version: 1.0

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 -


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