On Wed, 2008-01-16 at 22:40 +0000, Tim H. Panton wrote: > From what I heard at astri(dev?)con, this isn't quite right. > On some OS's multiple threads can read from the same UDP port. > These threads can be spread over multiple processors. >
They can in most infact, however the last thing you want is all of them just willy nilly grabbing packets, you want some front end saying 'this one is for this call, that one is for that call' and the overhead to pass them to the correct thread is high enough that doing a front end process like that, even with multiple threads is such that you dont want to (I addressed this in a previous email). You also dont want a ton of threads grabbing channels remotely and doing stuff to them, that would be a locking nightmare and probably cause a few channels to die mysterious deaths or just get into confused states or have garbled audio on occasion. Debugging why would also be problematic. The load of flipping locks on/off like that would also be counterproductive. It would be even worse if every thread read every packet and discarded what is not for it (assuming you could do that, given that you commented on it may not work in linux, it was sun guys ...) I dont know if this is what they were talking about, but if that happened there would be a memcpy for each and every read (which means packets per second * channels in use) from the kernel space network buffers to the userspace buffers, there would be a context switch, software irq or sysenter, stuff that would take a lot of cpu load. There may be some other way that isnt addressed here that doesnt have all of the negatives associated with it, but it would be very platform specific if it did exist. Now I am working on a way to avoid a lot of the overhead associated with a read, the memcpy, the context switch, etc are all removed. This could be adapted to asterisk, which would actually improve its performance dramatically, although I really dont know exact numbers for asterisk, I know with another softswitch that I am doing it for there is a 30-40% speed boost with my additions on bridged calls. -- Trixter http://www.0xdecafbad.com Bret McDanel Belfast +44 28 9099 6461 US +1 516 687 5200 http://www.trxtel.com the phone company that pays you! _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-biz mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-biz
