From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 22 18:08:26 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C11ED16A401 for ; Fri, 22 Feb 2008 18:08:26 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 6228713C501 for ; Fri, 22 Feb 2008 18:08:25 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m1MI8HXl011267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 23 Feb 2008 05:08:18 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id m1MI8H0Q036496; Sat, 23 Feb 2008 05:08:17 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m1MI8Ehm036459; Sat, 23 Feb 2008 05:08:14 +1100 (EST) (envelope-from peter) Date: Sat, 23 Feb 2008 05:08:14 +1100 From: Peter Jeremy To: Andrew Pogrebennyk Message-ID: <20080222180813.GD51095@server.vk2pj.dyndns.org> References: <200802221558.42443.sharadc@in.niksun.com> <47BEE6E7.9030804@portaone.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/ZYM6PqDyfNytx60" Content-Disposition: inline In-Reply-To: <47BEE6E7.9030804@portaone.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org, Sharad Chandra Subject: Re: usleep X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2008 18:08:26 -0000 --/ZYM6PqDyfNytx60 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 22, 2008 at 05:14:47PM +0200, Andrew Pogrebennyk wrote: >Additionally, this C routine is considered obsolete Can you provide a reference for this please. > (unlike shell command by the same name). I've never seen a shell function called usleep. Which shell are you using? > The interaction of this function with SIGALRM >and other timer functions such as sleep(), alarm(), setitimer(), and >nanosleep() is unspecified. Possibly on some OSs but not on FreeBSD. > Additionally, its use in multi-threaded >programs can lead to somewhat surprising results. Such as? If you are talking about having the process suspended instead of the thread then this is dependent on the threading library and the thread attributes and is no more or less surprising than any other similar function. > Use nanosleep(2) or setitimer(2) instead. If you bothered to read what Sharad had said, the man page or the source, you would find that usleep(3) _is_ implemented using nanosleep(2) so there is no point in using nanosleep() instead of usleep(). --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --/ZYM6PqDyfNytx60 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHvw+N/opHv/APuIcRAlgwAKC8b44TjBzig/OooY82Fnf0wu3UcQCggZAs HSlB6bjHDAOz5IGIiaGUvDY= =lFml -----END PGP SIGNATURE----- --/ZYM6PqDyfNytx60--