From owner-cvs-all Wed Dec 13 14:23:26 2000 From owner-cvs-all@FreeBSD.ORG Wed Dec 13 14:23:22 2000 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 749A737B404; Wed, 13 Dec 2000 14:23:21 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id RAA64192; Wed, 13 Dec 2000 17:22:50 -0500 (EST) (envelope-from wollman) Date: Wed, 13 Dec 2000 17:22:50 -0500 (EST) From: Garrett Wollman Message-Id: <200012132222.RAA64192@khavrinen.lcs.mit.edu> To: Julian Elischer Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mbuf.h In-Reply-To: <3A37EDE7.4E2A2F52@elischer.org> References: <3A37EDE7.4E2A2F52@elischer.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: > looking at the alpha code it looks like possibly cmpset instructions > have to be synthesised on alpha and might be quite expensive.. what > are the facts in this regard? That is why I keep on repeating that higher-level primitives are necessary. Some architectures have compare/set, some have compare/exchange, some have load-linked/store-conditional. While these are all theoretically equivalent, there is a difference, and the appropriate choice for IA32 is not necessarily the appropriate choice for any other architecture. Many architectures have restrictions on what data types can be used for this purpose (usually arising from the design of their bus interfaces). For reference counts, the appropriate ``building block'' is atomic_increment/atomic_decrement, not the underlying instruction-level primitive. (In both directions, the ``building block'' function is implemented as an explicit assembly-language inline which returns the *previous* value of the counter.) -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message