[ale] Mixing Alarm and Sleep

Pete Hardie pete.hardie at dvsg.sciatl.com
Mon Jan 21 15:05:36 EST 2002


Chris Fowler wrote:
> 
> Ah!  I'm having some issues using the alarm() call and the sleep() call in the same program.  The alarm call is in a library function.  Basically, another piece of source code.  It uses the alarm to timeout on sending
> and receiveing data over udp.   I nede to loop and sleep for 30 seconds.    The sleep is not sleeping for 30 seconds.   Bacically it would look like this.

>From the RH 6.2 man pages for sleep (man 3c sleep):

BUGS
       sleep() may be implemented using SIGALRM; mixing calls  to
       alarm() and sleep() is a bad idea.


Basically, sleep may use SIGALRM to wake up, so your calls to alarm() are
interfering.

-- 
Pete Hardie                   |   Goalie, DVSG Dart Team
    posting from, but not     |
	speaking for:             |
Scientific Atlanta, Digital Video Services Group


<html>
<body>
<font size="3" face="Times New Roman"><span style="mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">
- - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
<span style="font-size:10.0pt;font-family:Times New Roman;
mso-fareast-font-family:&quot;Times New Roman&quot;;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA"></span><font face="Times New Roman" size="3"><span style="mso-fareast-font-family:Times New Roman; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.</span></font></p>
</body>
</html>

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list