Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761286AbXK2Hvu (ORCPT ); Thu, 29 Nov 2007 02:51:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754619AbXK2Hvj (ORCPT ); Thu, 29 Nov 2007 02:51:39 -0500 Received: from mx12.go2.pl ([193.17.41.142]:50511 "EHLO poczta.o2.pl" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754610AbXK2Hvi (ORCPT ); Thu, 29 Nov 2007 02:51:38 -0500 Date: Thu, 29 Nov 2007 08:56:15 +0100 From: Jarek Poplawski To: davids@webmaster.com Cc: larry.finger@lwfinger.net, LKML Subject: Re: Question regarding mutex locking Message-ID: <20071129075615.GA9962@ff.dom.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1141 Lines: 28 On 29-11-2007 03:34, David Schwartz wrote: >> Thanks for the help. Someday, I hope to understand this stuff. >> >> Larry > > Any code either deals with an object or it doesn't. If it doesn't deal with > that object, it should not be acquiring locks on that object. If it does > deal with that object, it must know the internal details of that object, > including when and whether locks are held, or it cannot deal with that > object sanely. ... Maybe it'll unnecessarily complicate the thing, but since you repeat the need to know the object - sometimes the locking is done to synchronize something in time only, so to assure only one action is done at a time or a few actions are done in proper order, or/and shouldn't be broken in the meantime by other actions (so, no need to deal with any common data). But, of course, we can say an action could be a kind of object too. Regards, Jarek P. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/