setitimer() odd timing

Ian FREISLICH ianf at clue.co.za
Thu Nov 1 10:11:27 PDT 2007


Hi

I've got a issue that I noticed recently.  When I set an alarm()
or use setitimer() the signal delivery is delayed somewhat.  I'm
not sure if it's that the signal is delayed or if it's just that
the timer runs slowly.  I am using ITIMER_REAL.

It's pretty linear over 1 to 60 (asked for) seconds translating
them into 3.7 real seconds:

[apple] ~ # time sleep 5

real    0m18.542s
user    0m0.000s
sys     0m0.001s
[apple] ~ # time sleep 10

real    0m37.081s
user    0m0.000s
sys     0m0.001s
[apple] ~ # time sleep 60

real    3m42.468s
user    0m0.000s
sys     0m0.001s

The hardware in question is an Apple MacBook Pro.  FWIW, I don't
notice this on other i386 based hardware that I have.  It affects
things like ping, cron, atrun and xclock but not gettimeofday().

I'm not sure where to start looking.  If someone points me at what
needs instrumenting, I'll see if I can narrow the problem space.

Ian

--
Ian Freislich



More information about the freebsd-current mailing list