Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 88018 invoked from network); 12 Sep 2003 05:04:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Sep 2003 05:04:18 -0000 Received: (qmail 14502 invoked by uid 500); 12 Sep 2003 05:03:55 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 14471 invoked by uid 500); 12 Sep 2003 05:03:55 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 14458 invoked from network); 12 Sep 2003 05:03:55 -0000 X-Authentication-Warning: suntzu.lyra.org: gstein set sender to gstein@lyra.org using -f Date: Thu, 11 Sep 2003 22:02:00 -0700 From: Greg Stein To: Aaron Bannert Cc: dev@apr.apache.org Subject: Re: remove nested mutexes? Message-ID: <20030911220200.C27308@lyra.org> Mail-Followup-To: Aaron Bannert , dev@apr.apache.org References: <1A275117-E4DE-11D7-AC1A-000393B3C494@clove.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1A275117-E4DE-11D7-AC1A-000393B3C494@clove.org>; from aaron@clove.org on Thu, Sep 11, 2003 at 10:01:00PM -0700 X-URL: http://www.lyra.org/greg/ X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Thu, Sep 11, 2003 at 10:01:00PM -0700, Aaron Bannert wrote: > I propose we do one of the following. > > 1) Remove nested muxtes, meaning all mutexes become non-nested (they > will > deadlock whenever the same thread locks twice). > Pros: Nested mutexes are lame and are unnecessary. The current > implementation > in APR is broken. > Cons: Some applications may be written to rely on nested mutexes. I've written applications like this. One thread will create a mutex, stash that away in a global, or somesuch, and then lock the thing *twice*. When another thread wants the first one to resume, it unlocks the mutex. If we have another way for a thread to block, then have another thread say "okay. go ahead and proceed", then I'm all for removing nested mutexes. Cheers, -g -- Greg Stein, http://www.lyra.org/