From owner-cvs-all@FreeBSD.ORG Tue Apr 1 22:28:06 2008 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B501C1065674 for ; Tue, 1 Apr 2008 22:28:06 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mx1.freebsd.org (Postfix) with ESMTP id 4D49B8FC25 for ; Tue, 1 Apr 2008 22:28:06 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-067-234-219.pools.arcor-ip.net [88.67.234.219]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis) id 0ML25U-1JgoxZ06iL-0003I5; Wed, 02 Apr 2008 00:28:05 +0200 Received: (qmail 53899 invoked from network); 1 Apr 2008 22:27:08 -0000 Received: from myhost.laiers.local (192.168.4.151) by mx.laiers.local with SMTP; 1 Apr 2008 22:27:08 -0000 From: Max Laier Organization: FreeBSD To: Attilio Rao Date: Wed, 2 Apr 2008 00:25:57 +0200 User-Agent: KMail/1.9.9 References: <200804012031.m31KVtKs000176@repoman.freebsd.org> In-Reply-To: <200804012031.m31KVtKs000176@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804020025.57684.max@love2party.net> X-Provags-ID: V01U2FsdGVkX19eU462lXdWjyiiox5AwdXfaz2+rjf3EOGuGNs ks5mW4H6EvDv4zd51wumwmJ/RbGMX5Jr6zei2XYGZilQ5NSolT HAqUWGQh3+aIachNU1x3w== Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_rwlock.c src/sys/sys rwlock.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2008 22:28:06 -0000 On Tuesday 01 April 2008 22:31:55 Attilio Rao wrote: > attilio 2008-04-01 20:31:55 UTC > > FreeBSD src repository > > Modified files: > sys/kern kern_rwlock.c > sys/sys rwlock.h > Log: > Add rw_try_rlock() and rw_try_wlock() to rwlocks. > These functions try the specified operation (rlocking and wlocking) > and true is returned if the operation completes, false otherwise. hmmm ... I'm certainly missing something here, but what's a possible usecase for these? It seems there is not much you can do if you can't obtain a rw_lock. I can understand the need for sx_try_* where you want to avoid sleeping, but I can't figure out the need for it on a locking primitive that will only spin or wait (not 100% sure about the terminology here). This is especially strange for rw_try_wlock, unless you plan to sleep manually on fail. But then again you'd have a good chance that you have to do it over and over again if timing is unfortunate. > The KPI is enriched by this commit, so __FreeBSD_version bumping and > manpage updating will happen soon. > > Requested by: jeff, kris > > Revision Changes Path > 1.37 +49 -0 src/sys/kern/kern_rwlock.c > 1.17 +4 -0 src/sys/sys/rwlock.h -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News