Operating System - HP-UX
1837946 Members
2733 Online
110124 Solutions
New Discussion

accuracy of timeouts in select/poll in 11.11

 
aussel_1
New Member

accuracy of timeouts in select/poll in 11.11

With HP-UX 11.11, when I use select or poll to suspend a process for several tenths of milliseconds, the accuracy of the wake-up is not good.
The process can be awaken several tenths of milliseconds after the expected value.
The process is run with a "rtprio 100" command.
The computer has a very low CPU use.
If I use usleep instead of select/poll, it works fine.
When I run the same program on HP-UX 11.0, it works fine too.
I apply all the patches concerning select.
What can I do to make the select more precise with HP-UX 11.11 ?
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: accuracy of timeouts in select/poll in 11.11

Other operating system issues may be in play. Do you have a recently quarterly patch set installed?

If the system is very busy, there may be processes bound to the CPU preventing wake up.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kent Ostby
Honored Contributor

Re: accuracy of timeouts in select/poll in 11.11

There is a known issue in 11.11 where a poll of reused socket increases the wait time by a factor of 10.x.

The fix is in the 11.11 STREAMS patch PHNE_30367 .

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
rick jones
Honored Contributor

Re: accuracy of timeouts in select/poll in 11.11

While it should not be "too" much later, keep in mind that those timeouts are of the "guaranteed to to be less than" variety. So, getting say 49 ms on a 40 ms timer would not be surprising.

I suppose you could also try an event port - I'm ass-u-me-ing that your using selelect/poll implies that there are FD's whos read/write status needs to be determined. With the eventport patches installed (/dev/poll) you can do a "man 7 poll" to get the details. Otherwise, select/poll are not really meant to be used as just a sleep mechanism - at least not these days
there is no rest for the wicked yet the virtuous have no pillows