This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: platform usleep function


On 19 Dec 2002, Tom Tromey wrote:
> +inline void
> +_Jv_platform_usleep (unsigned long usecs)
> +{
> +  usleep (usecs);
> +}
> +

Is there any reason to prefer usleep over nanosleep?  The latter is POSIX
compatible and doesn't require signals.  Also, usleep is unusable on some
other platforms, including Solaris.

Whatever is used would preferably sleep and not spin.  I tested nanosleep
on x86-linux; it sleeps for durations as short as 20ms.  On
sparc-solaris2.8 it is usable down to 10ms.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]