Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750753AbWA3IXf (ORCPT ); Mon, 30 Jan 2006 03:23:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751258AbWA3IXf (ORCPT ); Mon, 30 Jan 2006 03:23:35 -0500 Received: from embla.aitel.hist.no ([158.38.50.22]:56292 "HELO embla.aitel.hist.no") by vger.kernel.org with SMTP id S1750753AbWA3IXe (ORCPT ); Mon, 30 Jan 2006 03:23:34 -0500 Message-ID: <43DDCE36.9020902@aitel.hist.no> Date: Mon, 30 Jan 2006 09:28:38 +0100 From: Helge Hafting User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: davids@webmaster.com CC: hyc@symas.com, Linux Kernel Mailing List Subject: Re: pthread_mutex_unlock (was Re: sched_yield() makes OpenLDAP slow) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1043 Lines: 23 David Schwartz wrote: > Third, there's the ambiguity of the standard. It says the "sceduling >policy" shall decide, not that the scheduler shall decide. If the policy is >to make a conditional or delayed decision, that is still perfectly valid >policy. "Whichever thread requests it first" is a valid scheduler policy. > > Sure. And with a "whichever thread aquires it first" policy, then it is obvious what happens when a mutex is released when someone is blocked on it: Whoever blocked on it first is then the one who requested it first - that cannot change as the request was made before the mutex even was released. So then, the releasing thread has no chance of getting the mutex back until the others have had a go at it - no matter what threads actually gets scheduled. Helge Hafting - 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/