<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Kevin P. Fleming wrote:
<blockquote cite="mid4648B907.1060501@digium.com" type="cite">
<pre wrap="">Vadim Lebedev wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap=""><!---->
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.
</pre>
</blockquote>
Kewin,<br>
<br>
Now, when we agree that it IS possible to use single pipe for multiple
bridges<br>
let's look on benefits:<br>
<br>
As for now Asterisk when packet arrives on a briged socket <br>
1. Thread switch to the reader thread<br>
2. read from socket + transfer of data from kernel to user<br>
3. thread swicth to writer thread<br>
4. write to socket + transfer of data from user to kernel<br>
<br>
Now if my proposal is implemented in the worst case we will economise 2
thread switches, 2 user/kernel data transfers <br>
plus we'll have much less threads in the system.<br>
<br>
I think we can expect pretty dramatic improvements<br>
<br>
Thanks<br>
Vadim<br>
<br>
<br>
<blockquote cite="mid4648B907.1060501@digium.com" type="cite">
<pre wrap="">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:
<a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a>
</pre>
</blockquote>
</body>
</html>