>I did say "as a general rule". If you know that "by design" nothing else
>is going to mess with what you're sleeping on before you wake up then
>you can make tighter optimisations but that's not the general case.
>There is such a thing as over optimisation though and for the sake of a
>simple if statement it is probably better to write code that is robust
>to changes made elsewhere in the system rather than squeeze every inch
>of performance out of the code, unless there's a real need to optimize
>in that particular area.

   In some cases it isn't practical or very expensive to verify that the
condition that caused the sleep in the first place has been satisfied - that's
often why certain parts of the kernel rely on the established tsleep symantics.


David Greenman
Co-founder, The FreeBSD Project - http://www.freebsd.org
Manufacturer of high-performance Internet servers - http://www.terasolutions.com
Pave the road of life with opportunities.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to