[asterisk-bugs] [Asterisk 0013011]: [patch] find_idle_thread() uses spin wait

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Nov 4 16:52:03 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13011 
====================================================================== 
Reported By:                jpgrayson
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13011
Category:                   Channels/chan_iax2
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-07-07 14:01 CDT
Last Modified:              2008-11-04 16:52 CST
====================================================================== 
Summary:                    [patch] find_idle_thread() uses spin wait
Description: 
When find_idle_thread() creates a new dynamic thread, it spins waiting for
the newly created thread to "signal" that it is up, running, and ready to
go. On a lightly loaded system, the child thread will be scheduled promptly
and the parent thread will thus probably not spin too much.

On a heavily loaded system, it might be possible for the parent thread to
be rescheduled many times prior to the child thread becoming ready. This is
a waste of CPU when the system can least afford it.

Instead of spin waiting, a condition variable can be used. This would make
the parent thread efficiently block until the child thread becomes ready.
====================================================================== 

---------------------------------------------------------------------- 
 (0094574) svnbot (reporter) - 2008-11-04 16:52
 http://bugs.digium.com/view.php?id=13011#c94574 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 154428

U   trunk/channels/chan_iax2.c

------------------------------------------------------------------------
r154428 | tilghman | 2008-11-04 16:52:02 -0600 (Tue, 04 Nov 2008) | 7
lines

Switch to using a thread condition to signal that a child thread is ready
for
work, rather than a busy wait.
(closes issue http://bugs.digium.com/view.php?id=13011)
 Reported by: jpgrayson
 Patches: 
       chan_iax2_find_idle.patch uploaded by jpgrayson (license 492)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=154428 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-11-04 16:52 svnbot         Checkin                                      
2008-11-04 16:52 svnbot         Note Added: 0094574                          
======================================================================




More information about the asterisk-bugs mailing list