From owner-freebsd-hackers Thu May 24 9: 2:19 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id A757B37B424 for ; Thu, 24 May 2001 09:02:17 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from onyx (onyx.cs.binghamton.edu [128.226.140.171]) by bingnet2.cc.binghamton.edu (8.11.2/8.11.2) with ESMTP id f4OG2Hu27693 for ; Thu, 24 May 2001 12:02:17 -0400 (EDT) Date: Thu, 24 May 2001 12:02:16 -0400 (EDT) From: Zhihui Zhang X-Sender: zzhang@onyx To: freebsd-hackers@freebsd.org Subject: shared versus exclusive lock Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG According to my reading of kern_lock.c, it does support shared lock. However, we are still using LK_EXCLUSIVE mode more often than necessary. If I want to look up a directory or to read a buffer, I should be able to use the LK_SHARED lock. Right now, only few places I have found using LK_SHARED, like in vn_read(). Is there any reason behind this? If I want to change this in my code, is there anything I should pay special attention to? Thanks. -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message