[lkml]   [2001]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: PROBLEM: select() on TCP socket sleeps for 1 tick even if data available
for (int i = 0; i < 1000; i++) {
struct timeval to;
to.tv_sec = 0;
to.tv_usec = 1000;
select(0, 0, 0, 0, &to);
return 0;

ia32 with HZ=100 means sleep will sleep for 10ms each time, no less.
The time passed to slect is a _minimum_ the kernel make no guarantee
it will be less, but assures it will be more (10ms is the default
timer interval for the intel platform, others (e.g. alpha) differ)

run your conde with strace -t to see what i mean

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:54    [W:0.123 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site