<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
> From: clemens@ladisch.de<br><div><div dir="ltr"><div>> To: nickycopeland@hotmail.com<br>> CC: d@drobilla.net; linux-audio-dev@lists.linuxaudio.org<br>><br>> Perhaps I should revisit another project I was working on which was syslog event<br>> correlation: it used multiple threads to be scalable to >1M syslog per second<br>> (big installation). I was testing it with socketpair()s and other stuff. I would be<br>> interested to know if scheduler changes affect it too.<br><br>So if the pipe() is replaced with <br><br>    socketpair(PF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_fd);<br><br>Then the issue I was seeing goes away. Perhaps the pipe() code has not been <br>optimised since sockets were developed to replace them when IPC suddenly <br>needed to be between hosts rather than processes? Pure conjecture.<br><br>[nicky@fidelispc] /tmp [148] cc ipc.c -lrt -DSET_RT_SCHED=1<br>[nicky@fidelispc] /tmp [149] ./a.out 4096 10000000<br>Sending a 4096 byte message 10000000 times.<br>Pipe send time:  26.131743<br>Pipe recv time:  26.132117<br>Queue send time: 18.576559<br>Queue recv time: 18.576592<br><br>The results were repeatable, CPU load was evenly distributed and the ludicrous<br>context switching figures were gone. Perhaps I should have replaced 'Pipe send time' <br>with 'Socket send time'? The message queues seem to maintain the best results.<br>Somebody should compare that to a shared memory lockless ringbuffer although<br>I have a feeling they will not exceed the messages queues used here.<br><br>Regards, nick.<br></div></div></div>                                          </div></body>
</html>