|
Posted by Leon Timmermans on July 1, 2008, 2:41 pm
Please log in for more thread options On Tue, 01 Jul 2008 12:36:50 -0400, Mark Seger wrote:
> I'd posted a note on HiRes earlier but things seem to be getting more
> complicated. Here are the facts as I understand them:
>
> - versions of HiRes older than 1.91 call setitimer with the entire time
> interval as usecs even if > 1sec. This is clearly in violation of the
> calling interface to setitimer, but with glibc versions <2.4 it still
> works correctly as I've been successfully using this for over 5 years. -
> with glibc 2.4, you get random results if the time >4 seconds - with
> glibc 2.5, you get failures but is seems only during boot!
Actually, it seems it isn't glibc but the linux kernel itself that
changed behavior (in release 2.6.21).
> I know this sounds odd, but I tried running a test that did alarms > 1
> second as an inet.d script and watched the console. I got errors while
> the system was booting and once it finished, the error messages stopped.
That's strange indeed.
> and I discovered I now have both the old and new version of HiRes
> installed. But what really makes this awful when I try to use HiRes
> perl loads the older one. Clearly it's a library search path issue but
> given this can run on any distro I can't make any assumptions about
> where the module actually gets installed.
>
> I'm not sure what the best solution to this is. Is there an easy way to
> remove the older version? Ultimately I want to be able to tell users of
> my tool how to get HiRes properly installed and they may not even be
> perl users or developers so the solution needs to be very simple.
>
You could try saying:
use Time::HiRes 1.91 qw/sleep gettimeofday/;
I'm not quite sure that's going to work though, the documentation isn't
clear on whether it will give up after rejecting the old version or
whether it will search on.
Alternatively, you could use plain old sleep. Inaccurate but reliable...
Leon
|