Date: Wed, 13 Dec 2000 17:22:50 -0500 (EST) From: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> To: Julian Elischer <julian@elischer.org> Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mbuf.h Message-ID: <200012132222.RAA64192@khavrinen.lcs.mit.edu> In-Reply-To: <3A37EDE7.4E2A2F52@elischer.org> References: <XFMail.001213105244.jhb@FreeBSD.org> <3A37EDE7.4E2A2F52@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
<<On Wed, 13 Dec 2000 13:45:11 -0800, Julian Elischer <julian@elischer.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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012132222.RAA64192>