increase select/poll timeout granularity on linux

Bas Denissen b.denissen at triple-it.nl
Wed Sep 23 21:00:51 CEST 2009


Hi,

Does anyone on this mailinglist know how to increase the select and/or 
poll timeout granularity on a linux system? It seems on all the linux 
boxes I have access to, to be 4 msec. Below is my small test program to 
test the granularity.

It probably has something to do with the HZ* settings of the linux 
kernel, but as far as I can see the standard fedora 11 kernel, which has 
HZ set to 1000, also has the 4 msec granularity...

Thanks for your help,

   Bas Denissen


=====================
use AnyEvent;

my $count = 0;

my $s = AnyEvent->timer (
	after => 1,
	interval => 1,
	cb => sub {
		print "$count\n";
		$count = 0;
	}
);

my $a = AnyEvent->timer (
	after => 0,
	interval => 1 / 1000,
	cb => sub {
		$count++;
	}
);


AnyEvent->condvar()->wait();

exit;



More information about the anyevent mailing list