From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 21 11:10:59 2015 Return-Path: Delivered-To: freebsd-hackers@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 63464258 for ; Tue, 21 Apr 2015 11:10:59 +0000 (UTC) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A09D1751 for ; Tue, 21 Apr 2015 11:10:59 +0000 (UTC) Received: by oica37 with SMTP id a37so147216490oic.0 for ; Tue, 21 Apr 2015 04:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=gvmvoTKvfvigVFDoytXxg0QJSm5+izZFpx2cpCN+MC4=; b=ChuIKl5RQl9OS044OV7znOs23n0LtXV2sc8QGOrzAil01q+9cAFbYxYmrAHsu3b0Sr fL9E6gC7FwmaEkffMTvLrJh57PI9ZtGn6FL09ljKfsOUA4bMycasI/1LBP8ru3Spj3bf POUDhtKxBcpkagQHXjEPF9F/76RccuWcBkkxuewjJm+FkZwZxIxkbNlaP1EwOa0tNJrY HX6IXaTJ2MOSXVkEOB5/kA79LG/IpSBg1Gn+eX8qlJVOi0tKXK1LtkQ1+/B6KBk2mX9R 87PVD6eO6p/P2OgnRFXPTYlS+yp9MGy0iCcviRvE1dprvtPRAm51PNfLpLhG1IY2OQ3T sXdg== MIME-Version: 1.0 X-Received: by 10.182.250.134 with SMTP id zc6mr18718765obc.78.1429614658471; Tue, 21 Apr 2015 04:10:58 -0700 (PDT) Received: by 10.60.24.10 with HTTP; Tue, 21 Apr 2015 04:10:58 -0700 (PDT) In-Reply-To: References: Date: Tue, 21 Apr 2015 16:40:58 +0530 Message-ID: Subject: Fwd: Clarification: Acquiring a mutex when a read/write lock is held From: Dheeraj Kandula To: freebsd-hackers@freebsd.org X-Mailman-Approved-At: Tue, 21 Apr 2015 11:34:07 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2015 11:10:59 -0000 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 the bounded sleep. Dheeraj