From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 31 09:38:14 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D4D316A4DA for ; Mon, 31 Jul 2006 09:38:14 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id D519243D70 for ; Mon, 31 Jul 2006 09:38:09 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Mon, 31 Jul 2006 17:38:07 +0800 id 00102E2D.44CDCF7F.00018427 References: <20060730105731.GA64955@stud.fit.vutbr.cz> <20060730200354.GA82547@stud.fit.vutbr.cz> <20060731085906.GA869@taran.infoua.com.ua> In-Reply-To: <20060731085906.GA869@taran.infoua.com.ua> From: "Intron" To: mykola.stryebkov@gmail.com Date: Mon, 31 Jul 2006 17:38:07 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: VM question related to faults 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, 31 Jul 2006 09:38:14 -0000 mykola.stryebkov@gmail.com wrote: > On 31.07.2006 14:12:20, Intron wrote: > >> Mutex(9) is sometimes too heavy, and has many limitations, while sx(9) >> is somewhat enough. > > First paragraph from sx(9) manual says: > > Shared/exclusive locks are used to protect data that are read > far more often than they are written. Mutexes are inherently > more efficient than shared/exclusive locks, so shared/exclusive > locks should be used prudently. > > > -- > Nick Strebkov > Public key: http://humgat.org/~nick/pubkey.txt > fpr: 552C 88D6 895B 6E64 F277 D367 8A70 8132 47F5 C1B6 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" But sx(9) also says in section "CONTEXT", A thread may hold a shared or exclusive lock on an sx lock while sleep- ing. You may try copyout() when holding a mutex(9) on 7.0-CURRENT. Look out for kernel crash. ------------------------------------------------------------------------ From Beijing, China