[reSIProcate] DumThread

Sergio García Murillo Sergio.Garcia at ydilo.com
Tue Apr 11 01:26:13 CDT 2006


To use multiple threads for the dum and the stack just do something like this:

       DumThread dumThread(dumUas),
       DumThread dumThread1(dumUas),
       DumThread dumThread2(dumUas),
       StackThread stackThread1(stackUas);
       StackThread stackThread2(stackUas);
       
       dumThread.run();
        	dumThread1.run();
        	dumThread2.run();
        	stackThread1.run();
       stackThread2.run();

I was using resiprocate-0.9.0-5019 and I had to apply a patch to the AbstractFifo for it to work properly, change the getNext method like this: 

void*
AbstractFifo::getNext(int ms)
{
    Lock lock(mMutex); (void)lock;

    const UInt64 end(Timer::getTimeMs() + ms);

    // Wait while there are messages available
    while (mFifo.empty())
    {
       // bail if total wait time exceeds limit
       bool signaled = mCondition.wait(mMutex, end - Timer::getTimeMs());
       if (!signaled)
       {
         return 0;
       }
    }

    // Return the first message on the fifo.
    void* firstMessage = mFifo.front();
    mFifo.pop_front();
    assert(mSize != 0);
    mSize--;
    return firstMessage;
}



________________________________________
From: resiprocate-devel-bounces at list.sipfoundry.org [mailto:resiprocate-devel-bounces at list.sipfoundry.org] On Behalf Of hanan aboudalal
Sent: lunes, 10 de abril de 2006 22:58
To: Suresh Rangaswamy
Cc: resiprocate-devel; resiprocate-devel-bounces
Subject: Re: [reSIProcate] DumThread

This is the same code that is used in BasicCall.cxx file. You can see that UAC and UAS both belong to the same thread and this is not the case in practical application. There should be a way to use DUM where UAS and UAC are two different excecutables (threads). Please any one have the answer? 
On 4/10/06, Suresh Rangaswamy <suresh at aylus.com> wrote: 
Hi All
I have the same question and how does this compare against the code snippet in the documentation.
 
 
 
while (!dumShutDown)
  {
     FdSet fdset;
     stack->buildFdSet(fdset);
     int err = fdset.selectMilliSeconds(stack->getTimeTillNextProcessMS());
     assert ( err != -1 );
     stack->process(fdset);
     while(dumUas->process());
  }
 
Thanks
Suresh
 
 
________________________________________
From: resiprocate-devel-bounces at list.sipfoundry.org [mailto:resiprocate-devel-bounces at list.sipfoundry.org ] 
Sent: Monday, April 10, 2006 3:27 PM
To: resiprocate-devel at list.sipfoundry.org
Subject: [reSIProcate] DumThread
 
Hi all:
 
What is the role of   resip:: DumThread and  resip::StackThread?  How can they be used? Are they helpful if I want the UAC to be in a thread and UAS to be in another thread? Please don't ignore my questions coz i realy need the answers as soon as possible. 
 
best regards,

_______________________________________________
resiprocate-devel mailing list
resiprocate-devel at list.sipfoundry.org
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel 

--------------------------------------------------------------------------------------
This message and any files transmitted with it are confidential and intended solely 
for the use of the individual or entity to whom they are addressed. No confidentiality 
or privilege is waived or lost by any wrong transmission. 
If you have received this message in error, please immediately destroy it and kindly 
notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, or copy any 
part of this message if you are not the intended recipient. Opinions, conclusions and 
other information in this message that do not relate to the official business of 
Ydilo Advanced Voice Solutions, S.A. shall be understood as neither given nor endorsed by it. 
--------------------------------------------------------------------------------------



More information about the resiprocate-devel mailing list