[Asterisk-Dev] rewriting asterisk as a state machine?

Steve Kann stevek at stevek.com
Thu Mar 3 13:17:35 MST 2005


Michael Giagnocavo wrote:

>Does Linux have the concept of fibers as NT does? If so, wouldn't that have
>some potential? TLS and locking mechanisms would have to be changed, but
>it'd be one way on cutting down on context switches without having to
>rewrite *everything*, right? Or am I completely off track here?
>
>  
>

Context switches on linux are cheap. On Windows, they're expensive. So 
on Windows, they try to avoid them:


http://www-106.ibm.com/developerworks/linux/library/l-rt9/?t=gr,lnxw03=RTCS

>-Michael
>
>-----Original Message-----
>From: asterisk-dev-bounces at lists.digium.com
>[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Nir Simionovich
>Sent: Thursday, March 03, 2005 1:54 PM
>To: 'Asterisk Developers Mailing List'
>Subject: RE: [Asterisk-Dev] rewriting asterisk as a state machine?
>
>Alex,
>
>  I would have to disagree with you on that one. Although CPU's are getting
>cheaper from day to day, that is not the way to go. 
>
>  The approach you are taking is: It's too slow, no problem, lets ramp up
>the minimum requirements. 
>
>  That kind of approach brought us products like Windows, where no matter
>what kind of power you have, it never works right. Now, lowering the number
>of CX's on the core would mean that the software density is improved
>dramatically, in addition to improving stability and reliability. Think of
>it this way, 3500 CX's means 3500 possible error locations, reduce that to
>50 or a 100, you do the math. 
>
>  I must admit that it had been a while since I've written a multi-threaded
>code in C/C++ (man I'm rusty), but the advantage is clear as the sun. For
>Asterisk to become bigger than life - parts of the switching core should be
>either optimized or completely re-written from scratch.
>
>JMHO
>
>Nir S
>
>-----Original Message-----
>From: asterisk-dev-bounces at lists.digium.com
>[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of
>alex at pilosoft.com
>Sent: Thursday, March 03, 2005 9:17 PM
>To: Asterisk Developers Mailing List
>Subject: Re: [Asterisk-Dev] rewriting asterisk as a state machine?
>
>On Thu, 3 Mar 2005, Roy Sigurd Karlsbakk wrote:
>
>  
>
>>in current asterisk gateway setups, a set of 20 active channels
>>generates something like 3500 context switches per second, giving a
>>170-200 context switches per channel per second. This is an awful lot...
>>    
>>
>It is an awful lot. But realistically, it should be at least 50 ctx 
>switches per channel per second (reading 20ms samples). 
>
>  
>
>>Would it be possible to rewrite asterisk so as each channel's data
>>read/write would be in common threads with a select() or so? what would
>>this take? this really would decrease the overhead on busy systems....
>>    
>>
>That would be a heavy rewrite, changing blocking code with threads into 
>nonblocking code with select() - is untrivial task, and probably 
>pointless.
>
>CPU are cheap.
>
>-alex
>
>_______________________________________________
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-dev
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>_______________________________________________
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-dev
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
>_______________________________________________
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-dev
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>  
>




More information about the asterisk-dev mailing list