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

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jul 7 14:07:06 CDT 2008


The following issue has been UPDATED. 
====================================================================== 
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:                     new
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:             07-07-2008 14:01 CDT
Last Modified:              07-07-2008 14:07 CDT
====================================================================== 
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.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-07-08 14:07  jpgrayson      Summary                  find_idle_thread() uses
spin wait => [patch] find_idle_thread() uses spin wait
======================================================================




More information about the asterisk-bugs mailing list