ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ccrtp-devel] Bug in SingleRTPSessionPool::run ?


From: Federico Montesino Pouzols
Subject: Re: [Ccrtp-devel] Bug in SingleRTPSessionPool::run ?
Date: Thu, 10 Nov 2005 11:49:34 +0100
User-agent: Mutt/1.5.11

   Hi, It's cool to see you are using the session pool succesfully. It
was introduced as an "experimental" feature which had not been
realistically tested. I'll commit your changes to CVS for the next
release. If you have any other suggestion, patch or idea, please send
it to us.

   The usleep(10) is an interesting point, and it could be made
optional depending on the app real-time requirements, or even mixed
with scheduler configuration calls -just an idea we could explore in
case performance issues arise. Did you try the yield() method of
Common C++ Threads?

   Just out of curiosity, are you dealing with a large number of
concurrent sessions?

   PS: You may want to upgrade to current (1.3.5) version as it
includes a number of fixes (mostly related to RTCP reports).

On Wed, Nov 09, 2005 at 02:52:34PM +0100, Guillaume FRAYSSE wrote:
> Hello
> 
> We've been using ccRTP 1.3.1 here for some time now. As we found it
> very CPU intensive to use a thread per session we made some
> tests with the SingleRTPSessionPool thread model and found out that it
> wasn't working.
> 
> Maybe we did something wrong, but after making the following change to
> the SingleRTPSessionPool::run method things run much better:
> 
> Here's the method after our modifications, I added //GF comments near our
> modifications. 
> 
> Any comments appreciated,
> Best Regards,
> Guillaume 
> 
> -------------------------
> void            
> SingleRTPSessionPool::run()
> {               
> #ifndef WIN32           
>         SOCKET so;
>         
>         while ( isActive() ) {
>                 PoolIterator i = sessionList.begin();
>                 while ( i != sessionList.end() ) {
>                         controlReceptionService(**i);
>                         controlTransmissionService(**i);
>                         i++;
>                 }
>         timeval timeout = getPoolTimeout();
>                 
>         //GF Reinitialize the fd set
>         FD_ZERO(&recvSocketSet);
>         for (PoolIterator j = sessionList.begin(); j !=
>         sessionList.end (); j++)
>         {
>                 SOCKET s = getDataRecvSocket(**j);
>                 FD_SET(s,&recvSocketSet);
>         }
>         //GF - end
>         
>         int n = select(highestSocket,&recvSocketSet,NULL,NULL,
>                                &timeout);
>                 i = sessionList.begin();
>                 while ( (i != sessionList.end()) ) {
>                         so = getDataRecvSocket(**i);
>                         if ( FD_ISSET(so,&recvSocketSet) && (n-- > 0)
>                                ) {
>                                 takeInDataPacket(**i);
>                         }
>                         dispatchDataPacket(**i);
>                         i++;
>                 }
>                 //GF we added that to allow the kernel scheduler  to
>                 give other tasks some time as if we have lots of
>                 active sessions the thread cann take all the CPU if we
>                 don't pause at all. We haven't found the best way to
>                 do that yet.
>                 usleep (10);
>         }
> #endif // ndef WIN32
> }
> 
> 
> _______________________________________________
> Ccrtp-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/ccrtp-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]