This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: platform usleep function
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>, Ranjit Mathew <rmathew at vsnl dot net>
- Date: Thu, 19 Dec 2002 18:23:32 -0500 (EST)
- Subject: 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