From owner-freebsd-threads@FreeBSD.ORG Fri Feb 20 14:24:37 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4082A16A4CE for ; Fri, 20 Feb 2004 14:24:37 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DDBC43D31 for ; Fri, 20 Feb 2004 14:24:37 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id B3DCE5309; Fri, 20 Feb 2004 22:54:36 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 93B675308; Fri, 20 Feb 2004 22:54:29 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 1EF1A33C6F; Fri, 20 Feb 2004 22:54:29 +0100 (CET) To: Daniel Eischen References: From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 20 Feb 2004 22:54:29 +0100 In-Reply-To: (Daniel Eischen's message of "Fri, 20 Feb 2004 15:28:10 -0500 (EST)") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 cc: threads@freebsd.org Subject: Re: cross-thread locking X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 22:24:37 -0000 Daniel Eischen writes: > Found it. It's in the Rationale -> System Interfaces -> General Info. > Here's a link that might get you there: > > http://www.opengroup.org/onlinepubs/007904975/xrat/xsh_chap02.html#tag_= 03_02_09 OK. It seems to me then that our spin locks are only superficially conformant. They are far heavier than the rationale suggests: they depend on malloc(), and they call pthread_self() which requires a full libpthread initialization. That makes them unsuitable in many cases. For instance, a malloc() implementation can't use our spin locks to protect its management structures. This happens to be a very real issue for me in my day job; I ended up writing my own spin lock implementation based solely on (anyone know of a good way to thoroughly test it, BTW?) DES --=20 Dag-Erling Sm=F8rgrav - des@des.no