From owner-freebsd-threads@FreeBSD.ORG Tue Apr 21 10:30:22 2015 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 079AB6CB for ; Tue, 21 Apr 2015 10:30:22 +0000 (UTC) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (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 C392512D6 for ; Tue, 21 Apr 2015 10:30:21 +0000 (UTC) Received: by oift201 with SMTP id t201so150387558oif.3 for ; Tue, 21 Apr 2015 03:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=mZ6lryBUnv+C/0lCcjSiU3CZaxihNH7VTejWeZHwxbY=; b=s/dbJzkuVL1DhLZ8SCWb/3QgOfPY9RnXkxMr/X1t3VwVmjIMlBSaExSYAEWxjdS537 jhsrMisSigWgGmAgBQkex7XQXEvu/miukaRhNhLbGH+vUylhPMg4qaCSgDjpJYuVUSor 1ndx3qydebVScAloL+lu+iDETygQX0VhsLIOm+0CDLBDYRCmiUetY62sllP9nu/u1KDI tBX62ZkekqwiQalyUAnceyWs29K9rVk0cm1kKFx2R4/r9A9ucALFFW8XgXMtILYHX5GG nuNocxFKOJvlJJu0WDP7THSxOilRXDhR48Y/jzZLp2wSRvqJfMKX+o5wl0m5TvkBGixO rFGQ== MIME-Version: 1.0 X-Received: by 10.182.250.134 with SMTP id zc6mr18584926obc.78.1429612221070; Tue, 21 Apr 2015 03:30:21 -0700 (PDT) Received: by 10.60.24.10 with HTTP; Tue, 21 Apr 2015 03:30:21 -0700 (PDT) Date: Tue, 21 Apr 2015 16:00:21 +0530 Message-ID: Subject: Clarification: Acquiring a mutex when a read write lock is held From: Dheeraj Kandula To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Tue, 21 Apr 2015 10:30:22 -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