From owner-freebsd-current@FreeBSD.ORG Wed Jun 4 06:16:31 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A1E637B401; Wed, 4 Jun 2003 06:16:31 -0700 (PDT) Received: from mx0.freebsd-services.com (survey.codeburst.net [195.149.39.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16E1B43F3F; Wed, 4 Jun 2003 06:16:30 -0700 (PDT) (envelope-from paul@freebsd-services.com) Received: by mx0.freebsd-services.com (Postfix, from userid 1002) id 069261B212; Wed, 4 Jun 2003 14:16:28 +0100 (BST) Date: Wed, 4 Jun 2003 14:16:28 +0100 From: Paul Richards To: Doug Rabson Message-ID: <20030604131628.GE68108@survey.codeburst.net> References: <26877.1054676171@critter.freebsd.dk> <20030603.160943.102571653.imp@bsdimp.com> <1054594801.1641.49.camel@cf.freebsd-services.com> <200306041001.07145.dfr@nlsystems.com> <20030604122445.GB68108@survey.codeburst.net> <1054730025.32554.15.camel@builder02.qubesoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1054730025.32554.15.camel@builder02.qubesoft.com> User-Agent: Mutt/1.5.4i cc: dfr@freebsd.org cc: phk@phk.freebsd.dk cc: "M. Warner Losh" cc: current@freebsd.org Subject: Re: VFS: C99 sparse format for struct vfsops X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 13:16:31 -0000 On Wed, Jun 04, 2003 at 01:33:46PM +0100, Doug Rabson wrote: > Interfaces actually can be added at runtime. Existing objects (i.e. > objects instantiated before the new interface was added) will continue > to work as before. If methods from the new interface are called on old > objects, the default method will be called. How can you add an interface at runtime? All of this runtime activity is theoretically possible, i.e. all these structures can be messed around with to add methods to existing objects etc. but wasn't kobj supposed to provide an OO type abstraction and therefore the interfaces and classes are determined at compile time. I'm not aware of any actual code that changes interfaces or classes at runtime and if we added that functionality then I think it would break the abstraction and complicate the usage of kobj for no real gain. Coming back to the central point, I don't understand why we need a cache at all. I don't see the reason for having to support the dispatching of anything other than the methods in the class that the object was instantiated into, so that means a relatively small fixed size method dispatch table. The only argument for that not working is if the class gets extended after the object is created but I'm not convinced yet that that's something to worry about in practice at least at the moment since we don't extend classes anywhere. Even if we added code to make that possible at runtime it would be simple enough to get a "miss" when looking that method up in older objects and to realloc the method table in the object to accomodate the new methods. Extending the class is something that is likely to be so rare that some performance penalty should that happen would be palatable. -- Tis a wise thing to know what is wanted, wiser still to know when it has been achieved and wisest of all to know when it is unachievable for then striving is folly. [Magician]