[asterisk-bugs] [Asterisk 0012814]: [patch] changes use of usleep to nanosleep

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jun 9 07:21:06 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12814 
====================================================================== 
Reported By:                pputman
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12814
Category:                   Applications/app_rpt
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 121228 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             06-09-2008 05:50 CDT
Last Modified:              06-09-2008 07:21 CDT
====================================================================== 
Summary:                    [patch] changes use of usleep to nanosleep
Description: 
very simple patch which changes the use of usleep in an instance where it's
argument was over 1 million to nanosleep to comply with the portability
setting on the janitor projects.
====================================================================== 

---------------------------------------------------------------------- 
 davidw - 06-09-08 07:21  
---------------------------------------------------------------------- 
It seems to me that "sleep" is most appropriate here.  The precision isn't
needed and my understanding is that all modern systems implement sleep to
the nearest tick, not the second.

Although Asterisk is generally unfriendly to power management, I gather
the latest trend in Linux is to consolidating timer scheduling and using a
tickless timer, to minimise the number of times the system is woken up.  I
haven't looked at the kernel source for a tickless Linux, but conceivably
nanosleep implies that the precision is intended whereas sleep doesn't,
and, in this case, precision isn't intended.  (One might well want to
disable the tickless logic for Asterisk, though.) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-09-08 07:21  davidw         Note Added: 0088469                          
======================================================================




More information about the asterisk-bugs mailing list