Yes, I felt this same frustration myself when writing our system. Unfortunately, most non-RT kernels/archs just dont give you sub-u second response.<br><br>We do use epoll(), and its fantastic at being responsive on lots of connections. <br>

<a href="http://sheddingbikes.com/posts/1280829388.html">http://sheddingbikes.com/posts/1280829388.html</a><br>An old, but good analysis: <a href="http://www.kegel.com/c10k.html#nb.epoll">http://www.kegel.com/c10k.html#nb.epoll</a><br>

<br>My final solution with all this was to maintain threads, w/ blocking reads, on connections I simply had to have super low latency response. And then use epoll for the rest, so as not to have too many threads. But if you are looking for a one-size fits all AIO solution... i doubt you will find it. I use a dummy pipe FD in my epoll sets to wake up the threads.<br>

<br>on your blocking reads, you can send a signal to wake them.<br><br>-Ed<br><br><div class="gmail_quote">On Fri, Jan 21, 2011 at 12:18 PM, Lennart Poettering <span dir="ltr">&lt;<a href="mailto:mzqohf@0pointer.de">mzqohf@0pointer.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Fri, 21.01.11 16:57, Simon McVittie (<a href="mailto:simon.mcvittie@collabora.co.uk">simon.mcvittie@collabora.co.uk</a>) wrote:<br>


<br>
&gt;<br>
&gt; On Fri, 21 Jan 2011 at 17:42:47 +0100, Lennart Poettering wrote:<br>
&gt; &gt; &gt; &gt; On Thu, Jan 20, 2011 at 8:14 AM, Simon McVittie<br>
&gt; &gt; &gt; &gt; &lt;<a href="mailto:simon.mcvittie@collabora.co.uk">simon.mcvittie@collabora.co.uk</a>&gt; wrote:<br>
&gt; &gt; &gt; It also seems rather perverse to go from int milliseconds (libdbus) to<br>
&gt; &gt; &gt; floating-point (libev) back to int milliseconds (poll/epoll/select)...<br>
&gt; &gt;<br>
&gt; &gt; (Just some nitpicking: neither epoll() nor select() actually take msec.)<br>
&gt;<br>
&gt; My mistake, select takes (seconds and) microseconds. That&#39;s a simple matter of<br>
&gt; integer arithmetic, though.<br>
&gt;<br>
&gt; The epoll_wait man page claims that epoll_wait and epoll_pwait take<br>
&gt; milliseconds. (Or is the man page wrong? I haven&#39;t got far enough with main<br>
&gt; loop restructuring to actually try epoll yet.)<br>
&gt;<br>
&gt; For completeness, poll does take milliseconds, and pselect and ppoll take<br>
&gt; (seconds and) nanoseconds. The wonderful thing about standards, etc.<br>
<br>
</div>Oops, sorry. I was wrong about epoll. It actually does take msec. Fucked<br>
up.<br>
<br>
timerfd() FTW!<br>
<br>
BTW, instead of using libev I&#39;d recommend everybody to just use epoll()<br>
together with signalfd() and timerfd(). Might not be portable, and not<br>
the API isn&#39;t the most elegant thing ever invented, but definitely<br>
capable, performant, accurate and working. And I&#39;d actually be happy<br>
with dropping compat with other Unixes and other crappy OSes... But it I<br>
guess that&#39;s just me, and there&#39;s enough politics in place to make that<br>
unlikely.<br>
<div class="im"><br>
Lennart<br>
<br>
--<br>
Lennart Poettering - Red Hat, Inc.<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dbus" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
</div></div></blockquote></div><br>