From owner-freebsd-current@FreeBSD.ORG Fri Sep 3 21:09:30 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7484316A4CE for ; Fri, 3 Sep 2004 21:09:30 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA1D243D2F for ; Fri, 3 Sep 2004 21:09:28 +0000 (GMT) (envelope-from keramida@linux.gr) Received: from gothmog.gr (patr530-a048.otenet.gr [212.205.215.48]) i83L9LLM002445; Sat, 4 Sep 2004 00:09:24 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i83L7RXT001335; Sat, 4 Sep 2004 00:07:27 +0300 (EEST) (envelope-from keramida@linux.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i83L7QGM001334; Sat, 4 Sep 2004 00:07:26 +0300 (EEST) (envelope-from keramida@linux.gr) Date: Sat, 4 Sep 2004 00:07:25 +0300 From: Giorgos Keramidas To: Maksim Yevmenkin Message-ID: <20040903210725.GA1199@gothmog.gr> References: <4138BE8D.7000102@savvis.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4138BE8D.7000102@savvis.net> Phone: +30-2610-312145 Mobile: +30-6944-116520 cc: freebsd-current@freebsd.org Subject: Re: fine grained locking and traversing linked lists X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Sep 2004 21:09:30 -0000 On 2004-09-03 11:57, Maksim Yevmenkin wrote: > > so, i've written a "spherical cow" that shows fine grained locking > when traversing linked lists (see below). basically, for double linked > list, in order to safely manipulate by object "y" one must hold three > locks: object "y" lock, object "x = y->previous" lock and object "z = > y->next" lock. > > so, the $1 million question is: am i missing something? or this will work? See ``the dining philosophers problem'' at Google.