From owner-svn-src-user@FreeBSD.ORG Tue Nov 16 22:26:22 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 952B2106566C; Tue, 16 Nov 2010 22:26:22 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 2FB3E8FC18; Tue, 16 Nov 2010 22:26:22 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 8378B1DD692; Tue, 16 Nov 2010 23:26:21 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 6CAA717120; Tue, 16 Nov 2010 23:26:21 +0100 (CET) Date: Tue, 16 Nov 2010 23:26:21 +0100 From: Jilles Tjoelker To: David Xu Message-ID: <20101116222621.GA44741@stack.nl> References: <201011120934.oAC9YLN1002510@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011120934.oAC9YLN1002510@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r215170 - in user/davidxu/libthr/sys: kern sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 22:26:22 -0000 On Fri, Nov 12, 2010 at 09:34:21AM +0000, David Xu wrote: > Author: davidxu > Date: Fri Nov 12 09:34:21 2010 > New Revision: 215170 > URL: http://svn.freebsd.org/changeset/base/215170 > Log: > Limit total number of robust mutexes a process can hold. I think a per thread limit is better as it is more predictable. If the limit is exceeded, pthread_mutex_lock() will fail. > [...] > + error = msleep(&max_robust_per_proc, > + &max_robust_lock, 0, "maxrob", 0); I think a PCATCH flag was intended here. If you want to do it this way, it needs to wake up if another thread in the process unlocks something. If one thread uses up max_robust_per_proc, it is stuck forever. It is also possible though rare that this wait forms a cycle with lock waits. -- Jilles Tjoelker