From owner-freebsd-current Mon Jul 12 22:47: 8 1999 Delivered-To: freebsd-current@freebsd.org Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (Postfix) with ESMTP id EC8CD14CA1 for ; Mon, 12 Jul 1999 22:47:06 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.3/8.8.8) with ESMTP id WAA04527; Mon, 12 Jul 1999 22:38:03 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Message-Id: <199907130538.WAA04527@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: "Andrew Reilly" Cc: Mike Smith , Mike Haertel , Matthew Dillon , Luoqi Chen , dfr@nlsystems.com, jeremyp@gsmx07.alcatel.com.au, freebsd-current@FreeBSD.ORG Subject: Re: "objtrm" problem probably found (was Re: Stuck in "objtrm") In-reply-to: Your message of "Tue, 13 Jul 1999 15:37:16 +1000." <19990713153716.A94421@gurney.reilly.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 12 Jul 1999 22:38:03 -0700 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Mon, Jul 12, 1999 at 07:09:58PM -0700, Mike Smith wrote: > > > Although function calls are more expensive than inline code, > > > they aren't necessarily a lot more so, and function calls to > > > non-locked RMW operations are certainly much cheaper than > > > inline locked RMW operations. > > > > This is a fairly key statement in context, and an opinion here would > > count for a lot; are function calls likely to become more or less > > expensive in time? > > Others have answered this question, but I thought I'd point out > that there is another alternative that is likely to be faster > than indirect function calls on some architectures: inline > branched code. So you still have a global variable selecting > locked/non-locked, but it's a boolean, rather than a pointer. > Your atomic macros are then { if (atomic_lock) asm("lock;foo"); > else asm ("foo"); } This requires you to have all the methods present at compile time, which defeats the entire purpose of dynamic method loading. -- \\ The mind's the standard \\ Mike Smith \\ of the man. \\ msmith@freebsd.org \\ -- Joseph Merrick \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message