Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932420AbWH1HbL (ORCPT ); Mon, 28 Aug 2006 03:31:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932412AbWH1HbL (ORCPT ); Mon, 28 Aug 2006 03:31:11 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:27858 "EHLO pentafluge.infradead.org") by vger.kernel.org with ESMTP id S932420AbWH1HbK (ORCPT ); Mon, 28 Aug 2006 03:31:10 -0400 Subject: Re: Why Semaphore Hardware-Dependent? From: Arjan van de Ven To: Dong Feng Cc: ak@suse.de, Paul Mackerras , Christoph Lameter , linux-kernel@vger.kernel.org In-Reply-To: References: Content-Type: text/plain Organization: Intel International BV Date: Mon, 28 Aug 2006 09:30:49 +0200 Message-Id: <1156750249.3034.155.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 835 Lines: 17 On Mon, 2006-08-28 at 03:22 +0800, Dong Feng wrote: > Why can't we have a hardware-independent semaphore definition while we > have already had hardware-dependent spinlock, rwlock, and rcu lock? It > seems the semaphore definitions classified into two major categories. > The main deference is whether there is a member variable _sleeper_. btw semaphores are a deprecated construct mostly; mutexes are the way to go for new code if they fit the usage model of mutexes. And mutexes are indeed generic (with a architecture hook to allow a specific operation to be optimized using assembly) - 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/