From owner-freebsd-smp@FreeBSD.ORG Fri Dec 16 08:43:44 2005 Return-Path: X-Original-To: freebsd-smp@freebsd.org Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26D9B16A41F for ; Fri, 16 Dec 2005 08:43:44 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id A999643D5C for ; Fri, 16 Dec 2005 08:43:43 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by zproxy.gmail.com with SMTP id z6so621985nzd for ; Fri, 16 Dec 2005 00:43:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VFD7xPmxv7fQSt1R13cxJLvHC60ALpVXOqOO6nbu9teqfOQvjcG7jMKmmWZCv3e4KRvQvVnI750BD2viDmdEyQEouUfIFw1MmACUj4apWmEWz27MdZmRjSuYNVRbng/rC+UWpCt6SYnIf3YmZiFtJAXaIxNR1CbzfO1oedmLuDE= Received: by 10.36.32.14 with SMTP id f14mr2335505nzf; Fri, 16 Dec 2005 00:43:40 -0800 (PST) Received: by 10.36.43.18 with HTTP; Fri, 16 Dec 2005 00:43:39 -0800 (PST) Message-ID: <3bbf2fe10512160043g2777a8f9t@mail.gmail.com> Date: Fri, 16 Dec 2005 00:43:39 -0800 From: rookie To: freebsd-smp@freebsd.org In-Reply-To: <3bbf2fe10512160041x7fd719bej@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1fa17f810512150652h5da6a6a5g3347f841a614689e@mail.gmail.com> <200512151257.22004.jhb@freebsd.org> <3bbf2fe10512151109w22ef9e2aj@mail.gmail.com> <200512152125.16004.max@love2party.net> <3bbf2fe10512160041x7fd719bej@mail.gmail.com> Subject: Re: Use turnstile to implement sx_lock X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rookie@gufi.org List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2005 08:43:44 -0000 > After some thinking this strikes me as wrong. You must not grant a slock > attempt if there is a thread with a higher priority waiting to get a xloc= k. > This does not mean that your approach doesn't work, but you have to keep > this > in mind. Yes, it's right. [snip] > > It seems to me that you are talking about the same things with slightly > different implementation details. It doesn't really matter much where th= e > queue of slocking threads is kept as long as it is easily and efficient t= o > update the turnstile's owner on sunlock. In practice it should be easier= to > have it in the turnstile as well and I still don't really understand why = you > (rookie) do not want to change turnstiles. In order to mantain current code for mutex (less changes mean less problems= ). However I think that a good start point would be writing code for a new primitive (as John and Max suggested) and I will concentrate my work there. Attilio -- Peace can only be achieved by understanding - A. Einstein