Kevin P. Fleming wrote:

Vadim Lebedev wrote:

The trick is that the pipe is ALWAYS empty.... And when we push
something to the pipe, we pull the data from it immideately afterwards.

So you've replaced a pair of read()/write() calls with two calls to
splice()? It's the same number of userspace/kernelspace boundary
crossings, I can't see how this would be any significant improvement at all.

Kewin,

Now, when we agree that it IS possible to use single pipe for multiple bridges
let's look on benefits:

As for now Asterisk when packet arrives on a briged socket
   1. Thread switch to the reader thread
   2. read from socket + transfer of data from kernel to user
   3. thread swicth to writer thread
   4. write to socket +  transfer of data from user to kernel

Now if my proposal is implemented in the worst case we will economise 2 thread switches, 2 user/kernel data transfers
plus we'll have much less threads in the system.

I think we can expect pretty dramatic improvements

Thanks
Vadim


The whole point of splice() and tee() are to allow *streams* of data to
be copied without having to bring the data from kernelspace to
userspace; doing it one packet at a time will probably defeat the
purpose of using them entirely.
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev


_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to