Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Aug 2000 20:22:46 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Stephen McKay <mckay@thehub.com.au>
Cc:        freebsd-current@FreeBSD.ORG, David Greenman <dg@root.com>, Alfred Perlstein <bright@wintelcom.net>
Subject:   Re: Ugly, slow shutdown 
Message-ID:  <23502.966018166@critter>
In-Reply-To: Your message of "Sat, 12 Aug 2000 03:02:40 %2B1000." <20000812030240.A668@gift.home> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20000812030240.A668@gift.home>, Stephen McKay writes:

>Regardless of the history of it all, FreeBSD is full of places where
>unexpected wakeups can stuff you right up.  Should we regard tsleep() like
>the older sleep() call, as suspect, and program defensively?  Should we
>be pragmatic, admit "We've gotten away with it so far", and document the
>"no sudden wakeups" behaviour?
>
>I quite like the general principle outlined in one of the earlier replies,
>that a while loop can be shown to be correct through a local code reading,
>but a simple conditional must be verified by reading all the rest of the
>code.  That's close to the same argument I use against global variables.
>Their use is too hard to verify as correct.

I support this notion with a footnote to the effect that if the test
is expensive the while() can be left out if a comment points out
exactly why the while() isn't needed.

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?23502.966018166>