just try to exchange glibc
> One interesting observation that sheds a bit of doubt on blaming
> glibc is that when the timeout is > 0 (ie I'm dropping packets),
> the ethernet driver is not receiving as many packets as the
> sender is sending. It also does not have any substantial amount
> of errors of any kind. The ports are connected via a loopback cable,
> and all 4 ports exhibit this behaviour. With a timeout of zero though,
> the send & receive counters are virtually identical.
...
Although that will not answer your question, just an idea, it will
certanly improve things alot:
if ( select(...) > 0 ) {
...
for ( ;; ) {
if ( read(fd, buffer, size) != size )
break;
... do something with your packet ...
}
}
Besides, select(2) cannot be "fast", look at poll(2), async io, or
just operate in blocking mode if your are in that critical timeline.
And lookup kernel archives about poll vs. select benchmarks to find
better explanation.
-alex
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/