Re: PROBLEM: select() on TCP socket sleeps for 1 tick even if data available

Chris Wedgwood (cw@f00f.org)
Sat, 20 Jan 2001 20:07:27 +1300


On Sat, Jan 20, 2001 at 01:54:23AM -0500, Michael Lindner wrote:

You know, there's one other possibility, and that's if the data that is
being sent isn't actually arriving until the next clock tick, which
means the delay is in the appearance of sent data, not in select().
Given that the two processes are on the same machine, I would expect a
send() on a TCP socket to deliver the data to its destination faster
than that, however.

You can measure this latency; and it's indeed very low (lmbench gives
28 usecs on one of my machines).

If process A blocks waiting for data, and process B sleeps after
writing this data intended to wake process A, it should wake almost
immediately.

If you don't see this I would suspect an application bug -- can you
use strace or some such and confirm this is not the case?

--cw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/