Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit
» 

DSPP Home

» HP STK home
Tru64 UNIX STK
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» FAQ
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
» DSPP
Content starts here

critical impact:

usleep, nanosleep - time resolution better than 10 ms is now supported on HPUX 11i V3 (CrCh389)

DA Impacts KN Impacts

Problem description

Using usleep or nanosleep, a process can be suspended from execution for an interval of time. The suspension time can be shorter than 10 ms in Tru64 UNIX, but in HP-UX 11i v2 time resolution better than 10 ms is not supported. However, Starting with HPUX 11i v3, time resolution better than 10 ms is supported.

void usleep(unsigned useconds);
int nanosleep (const struct timespec *rqtp, struct timespec *rmtp);

The usleep() function suspends the current process from execution for the number of microseconds specified by the useconds parameter.

The nanosleep() function suspends a process until one of the following conditions is met:

  • The time interval specified in rqtp has elapsed
  • A signal is delivered to the calling process and the action is to deliver a signal to a signal-catching function (or to terminate the process)

Other APIs that support time-based requests include ualarm(2), select(2), setitimer(2), timer_settime(2), sigtimedwait(2), semtimedop(2), poll(2), aio_suspend(2), and others. On HP-UX 11i v2, these also do not support time resolution better than 10 ms.

Identifiers

C/C++ Functionsaio_suspend C/C++ Functionsselect C/C++ Functionstimer_settime
C/C++ Functionsnanosleep C/C++ Functionssetitimer C/C++ Functionsualarm
C/C++ Functionspoll C/C++ Functionssigtimedwait C/C++ Functionsusleep

See also

Solution description

Support for higher time resolution in usleep, nanosleep, and other APIs is provided in HP-UX 11i v3.

The high resolution time support enhances the above timer-related system calls and APIs to provide a resolution finer than the default 10 millisecond resolution.

A new dynamic tunable hires_timeout_enable is provided to enable or disable this enhancement. By default, the enhancement is not enabled.

To enable high resolution time support, the tunable hires_timeout_enable can be set to 1. This will modify system-wide behavior of the timer related APIs to give a finer resolution.

Note that, turning on the tunable may lead to an increase in the number of timer-related interrupts.

See also


Problem summary

classifications source types OS release severity type
DA, KN C, C++ any HP-UX 11i version critical changed
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.