From owner-freebsd-current Mon Aug 7 12:21:44 2000 Delivered-To: freebsd-current@freebsd.org Received: from implode.root.com (root.com [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 41E2937B754; Mon, 7 Aug 2000 12:21:39 -0700 (PDT) (envelope-from dg@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.8/8.8.5) with ESMTP id MAA03649; Mon, 7 Aug 2000 12:03:43 -0700 (PDT) Message-Id: <200008071903.MAA03649@implode.root.com> To: Poul-Henning Kamp Cc: Alfred Perlstein , Matt Dillon , Mike Smith , Stephen McKay , freebsd-current@FreeBSD.ORG, dillon@FreeBSD.ORG Subject: Re: Ugly, slow shutdown In-reply-to: Your message of "Mon, 07 Aug 2000 20:34:03 +0200." <10526.965673243@critter.freebsd.dk> From: David Greenman Reply-To: dg@root.com Date: Mon, 07 Aug 2000 12:03:43 -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>Can you give a reason why we'll have to now start coding defensively >>because our arguments to tsleep() are just "advisory" now? > >It is not something we "suddenly have to do" it's been The Right Way >even since I first sharpened my teeth on unix kernels many years ago. Uh, Poul, I think you're full of it. The previous behavior of tsleep where you can make assumptions about who wakes you and under what conditions is a long and well established idiom. We (the kernel developers of BSD) have always coded to the established kernel programming interface and most of us consider it bad form to check for conditions which can't happen because the kernel API doesn't allow it. For example, we don't check for a NULL return from malloc in the case of !NO_WAIT, because we knew that the code would never do that. There are many other examples of similar assumptions in the kernel. We write the code to be efficient and only check for bogus conditions that might happen. The only exception to this is programatic ASSERTs that do internal consistency checks, but the purpose of those is quite different. -DG 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message