From owner-freebsd-threads@FreeBSD.ORG Wed Apr 22 15:05:28 2015 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D43EEC4 for ; Wed, 22 Apr 2015 15:05:28 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D45711CA4 for ; Wed, 22 Apr 2015 15:05:27 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-229-105.lns20.per1.internode.on.net [121.45.229.105]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t3MF5Mxr016827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 22 Apr 2015 08:05:25 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5537B8AD.5060009@freebsd.org> Date: Wed, 22 Apr 2015 23:05:17 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Dheeraj Kandula , freebsd-threads@freebsd.org Subject: Re: Clarification: Acquiring a mutex when a read write lock is held References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2015 15:05:28 -0000 On 4/21/15 6:30 PM, Dheeraj Kandula wrote: > Hey All, > Can you clarify the following > > I have a read write lock locked. Next I want to acquire a mutex when the > read write lock is held. Is this allowed or not. As far as I can understand > from the "FreeBSD Kernel Developers Handbook" this operation is allowed in > FreeBSD9.0, 10.0 and further. > > But the read write lock cannot be held while sleeping. Doesn't this > contradict the above statement, as a thread will go to sleep if can't > acquire the mutex when another thread holds the mutex. > > Hence what sleep are we referring here. Is this sleep(unbounded sleep) or look at man 9 locking for an overview. > the bounded sleep. > > Dheeraj > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > >