From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 18 16:02:57 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 583431065674 for ; Mon, 18 Aug 2008 16:02:57 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-gx0-f17.google.com (mail-gx0-f17.google.com [209.85.217.17]) by mx1.freebsd.org (Postfix) with ESMTP id EB3628FC1E for ; Mon, 18 Aug 2008 16:02:56 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by gxk10 with SMTP id 10so4334835gxk.19 for ; Mon, 18 Aug 2008 09:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=Z7384rLmA/fNJ45wupDqrzlJpIsUV0l8/WD9vwJQVVI=; b=coesCGR+ae6eDj8i8yus8DGT2cB89Q+KC8Q+M2bFroz/NbrbO65IU24tXIP4UFDjwe vaYW0jwXtM5Qb8bYZCcibyk9f3/ixmOwfExq7b2r2zSTf7lCLZ4hrQFSOaGjGB8xzJD1 gfzZGIBKuQ9ThmJwHvQxrgLXYKrKMKXt7t1xQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=KeF1WhgeXNPXqMcQmngQFVaEpdGDJf6KBFIJ+/ppwyAY0PIzTDZ9JJdl+j81Wu5tch i/5SraUiLBckastkMY+yeEDPYXFzTakPVx70+75zaC6KpyMW1qjw75q7vRhWzcoMlVtG yKilCwaWXYa6a4T+9I8m1qokHPHh2cVqFam3Q= Received: by 10.150.149.19 with SMTP id w19mr9944730ybd.50.1219075376342; Mon, 18 Aug 2008 09:02:56 -0700 (PDT) Received: by 10.150.225.21 with HTTP; Mon, 18 Aug 2008 09:02:56 -0700 (PDT) Message-ID: Date: Mon, 18 Aug 2008 12:02:56 -0400 From: "Ryan Stone" To: freebsd-hackers@freebsd.org In-Reply-To: <200808181754.18812.max@love2party.net> MIME-Version: 1.0 References: <200808181754.18812.max@love2party.net> X-Mailman-Approved-At: Mon, 18 Aug 2008 16:10:49 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Max Laier Subject: Re: Acquiring a mtx after an sx lock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2008 16:02:57 -0000 I guess the FreeBSD 8 man pages have been fixed but the FreeBSD 7 ones haven't. This is what I was looking at: http://www.freebsd.org/cgi/man.cgi?query=locking&apropos=0&sektion=0&manpath=FreeBSD+7.0-RELEASE&format=html Thanks for the response, Ryan Stone On Mon, Aug 18, 2008 at 11:54 AM, Max Laier wrote: > On Monday 18 August 2008 17:14:01 Ryan Stone wrote: > > Are there any problems acquiring a sleep mutex after acquiring an sx > lock? > > man 9 locking says that you can't, but doesn't provide any reasons. > > Obviously while you're holding the mutex you have to abide by the rules > > applying to mutexes, but as long as you do that, I can't see why > acquiring > > a mutex after an sx lock would cause an issue. Is the locking man page > > wrong about this? > > Where does it say so? The interaction table clearly shows: > > You have: You want: Spin_mtx Slp_mtx sx_lock rw_lock rm_locksleep > SPIN mutex ok-1 no no no no no-3 > Sleep mutex ok ok-1 no ok ok no-3 > | > V > sx_lock ok -->ok<-- ok-2 ok ok ok-4 > ^ > | > rw_lock ok ok no ok-2 ok no-3 > rm_lock ok ok no ok ok-2 no > > > -- > /"\ Best regards, | mlaier@freebsd.org > \ / Max Laier | ICQ #67774661 > X http://pf4freebsd.love2party.net/ | mlaier@EFnet > / \ ASCII Ribbon Campaign | Against HTML Mail and News >